:root {
    --bg-cream: #f6eee2;
    --card-cream: #fff8ed;
    --burgundy: #7b143a;
    --burgundy-dark: #5a0f2a;
    --gold: #d9aa4f;
    --gold-soft: #e2bd6d;
    --border-soft: #e0cbb2;
    --text-main: #3a2622;
    --text-muted: #7b5c52;
}

/* Reset / base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-size: 17px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-cream);
    color: var(--text-main);
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Top nav */
.top-nav {
    position: relative;
    top: 0;
    z-index: 1000;
    background: rgba(123, 20, 58, 0.98); /* burgundy */
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fdf7ea;
}

.logo-img {
    height: 56px;
    width: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

@media (max-width: 600px) {
    .logo-img {
        height: 46px;
    }
}

.logo-text {
    display: inline-block;
    white-space: normal;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

/* Nav links */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
}

.nav-links a {
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    color: #fdf7ea;
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover {
    background: rgba(253, 247, 234, 0.12);
    border-color: rgba(253, 247, 234, 0.45);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.pill-donate {
    background: var(--gold);
    color: var(--burgundy-dark);
    font-weight: 600;
}

.pill-donate:hover {
    background: var(--gold-soft);
}

/* Layout */
.page-wrapper {
    max-width: 1100px;
    margin: 30px auto 40px;
    padding: 0 16px 40px;
}

.section {
    margin-top: 32px;
}

.section h2 {
    margin: 0 0 12px;
    font-size: 1.45rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--burgundy-dark);
}

/* Cards */
.card {
    background: var(--card-cream);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(70, 32, 28, 0.35);
    border: 1px solid rgba(185, 150, 120, 0.95);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

/* Hero */
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 10px;
}

/* halo behind hero */
.hero-grid::before {
    content: "";
    position: absolute;
    inset: -40px -60px 10px;
    z-index: -1;
    background: radial-gradient(
        circle at left top,
        rgba(255, 248, 237, 0.95) 0%,
        rgba(250, 228, 204, 0.7) 35%,
        rgba(214, 178, 152, 0.0) 75%
    );
    pointer-events: none;
}

.hero-left h1 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 2.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--burgundy-dark);
}

.hero-verse {
    margin: 0 0 4px;
    font-size: 0.92rem;
}

.hero-ref {
    margin: 0 0 14px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

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

/* Zoom card */
.hero-right p {
    margin-top: 6px;
    font-size: 0.9rem;
}

.zoom-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
}

.zoom-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--burgundy-dark);
}

.status-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill.offline {
    background: #e0e0e0;
    color: #555555;
}

.status-pill.online {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Buttons */
.pill-button,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    background: var(--burgundy);
    color: #fdf7ea;
}

.pill-button:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(85, 14, 40, 0.55);
    background: var(--burgundy-dark);
}

.pill-secondary {
    background: transparent;
    color: var(--burgundy-dark);
    border: 1px solid rgba(123, 20, 58, 0.35);
    box-shadow: 0 3px 10px rgba(60, 40, 30, 0.15);
}

.pill-secondary:hover {
    background: rgba(252, 245, 232, 0.9);
}

/* Service cards */
.service-card h3 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 1rem;
}

.service-time {
    margin: 0 0 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Media */
.media-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr);
    gap: 16px;
}

.pill-tabs {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: #f0e0d1;
    gap: 4px;
    margin-bottom: 10px;
}

.pill-tab {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-main);
}

.pill-tab.active {
    background: var(--burgundy);
    color: #fdf7ea;
}

.media-body {
    font-size: 0.9rem;
}

.media-photo {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 8px;
}

.media-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.youtube-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--burgundy-dark);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Donate */
.donate-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.donate-card p {
    margin: 0;
    max-width: 480px;
}

/* Forms */
.form-grid {
    display: grid;
    gap: 10px;
}

.form-row label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    padding: 8px 10px;
    font-size: 0.9rem;
    background: #fffdf7;
}

.form-row textarea {
    resize: vertical;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    margin-right: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert.success {
    background: #c9e6c4;
    color: #245424;
}

.alert.error {
    background: #f7c4c0;
    color: #7a2620;
}

/* Contact */
.contact-subtext {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Map */
.map-embed iframe {
    width: 100%;
    border: 0;
    border-radius: 14px;
    min-height: 260px;
}

.map-links {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--burgundy-dark);
    padding: 16px;
    font-size: 0.8rem;
    color: #fdf7ea;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

/* Admin-specific small tweaks */
.admin-body {
    background: var(--bg-cream);
}

/* Responsive: hero/media grid + nav row */
@media (max-width: 800px) {
    .hero-grid,
    .media-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .nav-inner {
        flex-direction: row;
        align-items: center;
    }

    .nav-links {
        justify-content: flex-start;
    }
}

@keyframes fadeUpSoft {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Entrance animation */
.hero-left,
.hero-right,
.section .card,
.section .card-grid .card {
    opacity: 0;
    animation: fadeUpSoft 0.7s ease-out forwards;
}

/* slight stagger */
.hero-right { animation-delay: 0.08s; }
.section:nth-of-type(2) .card,
.section:nth-of-type(2) .card-grid .card { animation-delay: 0.12s; }
.section:nth-of-type(3) .card,
.section:nth-of-type(3) .card-grid .card { animation-delay: 0.18s; }
.section:nth-of-type(4) .card,
.section:nth-of-type(4) .card-grid .card { animation-delay: 0.24s; }
.section:nth-of-type(5) .card,
.section:nth-of-type(5) .card-grid .card { animation-delay: 0.30s; }
.section:nth-of-type(6) .card,
.section:nth-of-type(6) .card-grid .card { animation-delay: 0.36s; }

/* Prevent sticky header from covering anchor targets */
#about,
#services,
#media,
#donate,
#prayer,
#contact,
#location {
    scroll-margin-top: 20px;
}

/* smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Media page tabs & gallery */
.media-tabs .pill-tab {
    border: none;
    background: transparent;
    cursor: pointer;
}

.media-pane {
    display: none;
    margin-top: 10px;
}

.media-pane.active {
    display: block;
}

.gallery-main {
    margin-bottom: 10px;
}

.gallery-caption {
    margin-top: 4px;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-top: 4px;
}

.gallery-thumb-btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.gallery-thumb-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    opacity: 0.7;
    border: 2px solid transparent;
    transition: opacity 0.12s ease, border-color 0.12s ease;
}

.gallery-thumb-btn:hover .gallery-thumb-img,
.gallery-thumb-btn:focus-visible .gallery-thumb-img {
    opacity: 1;
    border-color: var(--burgundy);
}

.media-video-item:not(:last-child) {
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(185, 150, 120, 0.5);
}

/* Contact – social icons */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 3px 10px rgba(60, 40, 30, 0.25);
}

.social-icon i {
    pointer-events: none;
}

.social-icon.facebook { background: #1877f2; }
.social-icon.youtube  { background: #ff0000; }
.social-icon.instagram {
    background: radial-gradient(circle at 30% 30%,
        #fdf497, #fd5949 45%, #d6249f 70%, #285AEB 100%);
}

/* ===== Admin login ===== */
.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-login-form input[type="text"],
.admin-login-form input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 999px;
    border: 2px solid #b8895b;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.admin-login-form input[type="text"]:focus,
.admin-login-form input[type="password"]:focus {
    outline: none;
    border-color: #8b1432;
    box-shadow: 0 0 0 2px rgba(139, 20, 50, 0.15);
}

.admin-login-form .btn-primary {
    margin-top: 0.5rem;
    align-self: flex-start;
}

.form-error {
    margin-top: 0.5rem;
    color: #8b1432;
    font-size: 0.85rem;
}

/* Zoom live indicator */
.zoom-status.live-now .status-pill.online {
    animation: zoom-pulse 1s ease-in-out infinite;
}

@keyframes zoom-pulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(123, 20, 58, 0.7); }
    50%  { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(123, 20, 58, 0.0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(123, 20, 58, 0.0); }
}

/* Mobile navigation base */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
}

.nav-bar {
    display: block;
    width: 28px;
    height: 4px;
    margin: 4px 0;
    background-color: #fdf7ea;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Pastor page layout */
.pastor-card .pastor-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.pastor-card .pastor-photo {
    flex: 0 0 280px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.pastor-card .pastor-photo-img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 24px;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    animation: pastorFadeIn 0.8s ease-out forwards;
}

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

.pastor-card .pastor-content {
    flex: 1 1 260px;
}

@media (max-width: 768px) {
    .pastor-card .pastor-grid {
        flex-direction: column;
        align-items: center;
    }

    .pastor-card .pastor-photo {
        flex: 0 0 auto;
        margin-bottom: 16px;
    }

    .pastor-card .pastor-photo img {
        max-width: 200px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    }
}

/* Pastor media & staff directory */
.pastor-media-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pastor-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.pastor-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.pastor-audio-wrapper {
    margin-top: 8px;
}

.pastor-audio-label {
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.staff-section {
    margin-top: 24px;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.staff-card h3 {
    margin-bottom: 4px;
}

.staff-role {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #7a2620;
}

.staff-bio {
    font-size: 0.9rem;
}

/* Home & media thumbnails */
.media-photo-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.media-thumb {
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

/* Thumbnail images */
.media-thumb img {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.media-thumb:hover img,
.media-thumb:focus-visible img {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

/* Media page gallery grid */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.media-gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

@media (max-width: 1024px) {
    .media-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .media-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-gallery-item img {
        height: 120px;
    }
}

/* Final mobile nav overrides */
@media (max-width: 768px) {
    .nav-inner {
        align-items: center;
        flex-direction: row;
    }

    .nav-logo {
        flex: 1 1 auto;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-left: auto;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px 16px;
        background: var(--burgundy-dark);
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
        z-index: 2000;
    }

    .nav-links a {
        display: block;
        padding: 8px 4px;
    }

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

    .nav-toggle.is-open .nav-bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle.is-open .nav-bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.is-open .nav-bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .logo-text {
        font-size: 0.95rem;
    }
}

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.lightbox-overlay.is-open {
    display: flex;
}

.lightbox-inner {
    max-width: 900px;
    width: 100%;
    background: #fff8ed;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.lightbox-caption {
    margin-top: 6px;
    font-size: 0.9rem;
}

.no-scroll {
    overflow: hidden;
}
