/* ===== TOKENS ===== */
:root {
    --primary: #2C4A7C;       /* deep calm blue - nav, headings */
    --primary-dark: #1D3357;  /* hero gradient end */
    --primary-tint: #EAF0F9;  /* very light blue section backgrounds */
    --accent: #C99B4A;        /* warm gold - used sparingly for one signature moment */
    --background: #F5F7FB;
    --card: #ffffff;
    --text: #1E2430;
    --muted: #667085;
    --shadow: 0 10px 30px rgba(29, 51, 87, 0.08);
    --shadow-hover: 0 14px 34px rgba(29, 51, 87, 0.14);
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.55;
}

h1, h2, h3, h4 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0 0 8px;
}

p { color: var(--muted); margin: 6px 0; }

a { color: inherit; }

/* ===== IDENTITY BANNER (logo, name, mission - not sticky, this is the "wow" moment) ===== */
.site-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 44px 32px;
}

.banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
}

.banner-logo img {
    height: 190px;
    width: 190px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: white;
    border: 5px solid var(--accent);
    box-shadow: 0 14px 40px rgba(0,0,0,0.45);
}

.brand-mark {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 5px solid var(--accent);
    align-items: center;
    justify-content: center;
    font-size: 40px;
    letter-spacing: 0.5px;
    color: white;
}

.banner-text { color: white; }

.banner-name {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 46px;
    color: white;
    line-height: 1.1;
    margin: 0 0 14px;
}

.banner-mission {
    font-size: 19px;
    font-weight: 400;
    color: rgba(255,255,255,0.88);
    max-width: 760px;
    line-height: 1.5;
    margin: 0;
}

/* ===== SITE NAV (slim, sticky, just the links) ===== */
.site-nav {
    background: var(--primary-dark);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.site-nav ul {
    display: flex;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.82;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover { opacity: 1; }

.site-nav a.active {
    opacity: 1;
    border-bottom-color: var(--accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: white;
    display: block;
}

/* ===== LIVE INDICATOR ===== */
#live-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-dark);
    color: white;
    padding: 10px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

#live-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ===== HERO ===== */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    padding: 80px 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.hero-text h2 {
    font-size: 42px;
    color: white;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero-text p {
    color: rgba(255,255,255,0.85);
    font-size: 18px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    margin-top: 26px;
}

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary-dark);
}

.btn-secondary {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
}

.btn:hover { transform: translateY(-2px); }

/* Signature element: the "next gathering" card in the hero */
.next-gathering {
    background: white;
    color: var(--text);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-hover);
    border-top: 4px solid var(--accent);
}

.next-gathering .eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.next-gathering .when {
    font-family: 'Fraunces', serif;
    font-size: 26px;
    color: var(--primary-dark);
    font-weight: 600;
}

.next-gathering-time {
    margin-top: 4px;
    color: var(--primary);
    font-weight: 600;
    font-size: 15px;
}

.next-gathering .where {
    margin-top: 12px;
    color: var(--muted);
}

/* ===== SECTION BACKGROUNDS (alternate for visual separation) ===== */
.section-alt {
    background: var(--primary-tint);
}

/* ===== PHOTO FRAME (with graceful "not uploaded yet" placeholder) ===== */
.photo-frame {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3;
    background: #dfe6f2;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-placeholder {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 14px;
    background:
            repeating-linear-gradient(45deg, rgba(44,74,124,0.06) 0 10px, transparent 10px 20px),
            var(--primary-tint);
    border: 2px dashed rgba(44,74,124,0.35);
}

.photo-frame.photo-missing img { display: none; }
.photo-frame.photo-missing .photo-placeholder { display: flex; }

/* ===== WELCOME / SPLIT SECTION ===== */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 64px 48px;
    max-width: 1100px;
    margin: 0 auto;
}

.split-text h2 { font-size: 30px; }
.split-text p { font-size: 16px; }

/* ===== GALLERY ===== */
#gallery-section {
    display: none; /* JS reveals this once at least one photo is found */
    padding: 64px 48px;
}

.gallery-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 32px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== SLIDESHOW ===== */
.slideshow-viewport {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    aspect-ratio: 16 / 9;
    background: #dfe6f2;
}

.slideshow-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.slide {
    min-width: 100%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(29, 51, 87, 0.55);
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 2;
}

.slide-arrow:hover { background: var(--primary-dark); }
.slide-prev { left: 16px; }
.slide-next { right: 16px; }

.slide-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.slide-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.slide-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

/* ===== LIGHTBOX (click a slide to enlarge) ===== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.open { opacity: 1; }

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

@media (max-width: 700px) {
    .slideshow-viewport { aspect-ratio: 4 / 3; }
    .slide-arrow { width: 36px; height: 36px; font-size: 20px; }
    .lightbox-nav { width: 42px; height: 42px; font-size: 22px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* ===== PREVIEW SECTION HEADER (with "see all" link) ===== */
.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto 28px;
    padding: 0 4px;
}

.section-heading h2 { margin: 0; text-align: left; }

.section-heading a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.section-heading a:hover { text-decoration: underline; }

/* ===== STAFF DIRECTORY ===== */
.staff-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.staff-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 26px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.staff-photo {
    width: 110px;
    height: 110px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.staff-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.staff-initials {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: var(--primary-tint);
    color: var(--primary);
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 28px;
}

.staff-role {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

/* ===== WEEKLY SCHEDULE (calendar strip) ===== */
.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    max-width: 1100px;
    margin: 0 auto;
}

.week-day {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 3px solid transparent;
}

.week-day.has-events {
    border-top-color: var(--accent);
}

.week-day-label {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--primary-tint);
    margin: 0;
}

.week-item-label {
    font-weight: 600;
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.3;
    margin: 0;
}

.week-item-time {
    color: var(--muted);
    font-size: 11.5px;
    margin: 2px 0 0;
}

.week-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.week-day-empty {
    color: var(--muted);
    opacity: 0.4;
    margin: auto 0;
    font-size: 13px;
}

@media (max-width: 800px) {
    .week-grid {
        grid-template-columns: 1fr;
    }

    .week-day {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 18px;
        text-align: left;
        min-height: auto;
        padding: 14px 18px;
        border-top: none;
        border-left: 3px solid transparent;
    }

    .week-day.has-events {
        border-left-color: var(--accent);
    }

    .week-day-label {
        border-bottom: none;
        padding-bottom: 0;
        min-width: 44px;
        flex-shrink: 0;
    }

    .week-items,
    .week-day-empty {
        flex: 1;
    }
}

/* ===== GIVE PAGE ===== */
.give-highlight {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    padding: 48px 32px;
    box-shadow: var(--shadow-hover);
}

.give-highlight .eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.give-highlight-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    margin-bottom: 24px;
}

.give-btn {
    font-size: 16px;
    padding: 14px 32px;
}

.give-note {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ===== SOCIAL PAGE ===== */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 32px;
}

.social-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.social-card a {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease;
}

.social-card a:hover { background: var(--primary-dark); }

/* ===== QUICK CARDS ===== */
.quick-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 48px;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: white;
    padding: 28px;
    text-align: center;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    font-weight: 600;
}

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

/* ===== PAGE WRAPPER ===== */
.page {
    padding: 56px 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.page-hero {
    text-align: center;
    padding: 64px 32px;
    background: var(--primary-tint);
}

.page-hero h2 { font-size: 34px; }

.page h2 {
    text-align: center;
    margin-bottom: 36px;
    font-size: 30px;
}

/* ===== GRID SYSTEM ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

/* ===== CARDS (sermons/events/visit boxes) ===== */
.video-card,
.card-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.video-card iframe {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    border: none;
}

/* The live player gets its own larger, centered treatment - it's the
   featured thing on the page when it's showing, not a grid thumbnail. */
.live-player {
    max-width: 800px;
    margin: 0 auto;
}

.live-player iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Event cards get their own rule since a photo (optional) needs to sit flush
   with the card edges, with only the text portion padded below it. */
.event-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.event-photo {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #dfe6f2;
}

.event-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-card-body {
    padding: 20px;
}

.event-date {
    color: var(--primary);
    font-weight: 600;
}

.loading-msg {
    text-align: center;
    grid-column: 1 / -1;
    color: var(--muted);
    padding: 20px;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 36px;
    margin-top: 40px;
    background: var(--primary-dark);
    color: rgba(255,255,255,0.85);
}

.footer-title {
    color: white;
    font-family: 'Fraunces', serif;
    font-size: 18px;
    margin-bottom: 6px;
}

footer p { color: rgba(255,255,255,0.75); margin: 3px 0; }

/* ===== MOBILE ===== */
@media (max-width: 800px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 56px 24px;
        text-align: center;
    }
    .hero-actions { justify-content: center; }
    .hero-text p { margin: 0 auto; }
}

@media (max-width: 900px) {
    .banner-inner {
        flex-direction: column;
        text-align: center;
    }
    .banner-mission { max-width: 100%; }
}

@media (max-width: 1050px) {
    .nav-toggle { display: flex; }

    #nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--primary-dark);
        padding: 16px 24px;
        gap: 16px;
        text-align: center;
    }

    #nav-menu.open { display: flex; }
}

@media (max-width: 700px) {
    .banner-logo img,
    .brand-mark { height: 130px; width: 130px; }
    .banner-name { font-size: 34px; }
    .banner-mission { font-size: 16px; }
}