/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    /* Color Palette - Blue/White Theme */
    --color-primary: #00509d;
    /* Royal Blue */
    --color-secondary: #fdc500;
    /* Keep Gold for specific accents or change? User said Blue/White INSTEAD of Green/Gold. Let's make secondary a lighter blue or white-ish */
    /* actually, "Blue/White instead of Green/Gold" implies: */
    /* Green -> Blue */
    /* Gold -> White/Silver */
    --color-primary: #003366;
    /* Navy Blue */
    --color-secondary: #e6f3ff;
    /* Very Light Blue (almost white) for backgrounds/sections */
    --color-background: #ffffff;
    /* Pure White */
    --color-surface: #f0f8ff;
    /* Alice Blue */
    --color-accent: #3399cc;
    /* Lighter Blue */
    --color-text: #333333;
    --color-text-light: #555555;
    --color-border: #d1d9e6;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.section {
    padding: var(--spacing-lg) 0;
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.grid {
    display: grid;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

/* Card Link Styles */
.highlight-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.highlight-card h3 a:hover {
    color: var(--color-accent);
}

/* Home Updates Section */
.home-updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    /* Slightly smaller min-width to fit 4 on desktop */
    gap: var(--spacing-md);
    margin-top: 2rem;
}

.update-box {
    padding: 2.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--color-border);
}

.update-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.update-box.bible-quote {
    background-color: var(--color-primary);
    color: white;
}

.update-box.bible-quote blockquote {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.update-box.bible-quote cite {
    font-style: normal;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.9;
}

.update-box.birthday-wishes {
    background-color: var(--color-surface);
    border-top: 5px solid var(--color-accent);
}

.update-box.announcements {
    background-color: var(--color-secondary);
    color: var(--color-primary);
}

.update-box h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.birthday-list,
.announcement-list {
    list-style: none;
    padding: 0;
    text-align: left;
}

.birthday-list li,
.announcement-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
}

.birthday-list li:last-child,
.announcement-list li:last-child {
    border-bottom: none;
}

.btn-primary {
    /* ... rest of buttons */
    background-color: var(--color-primary);
    color: var(--color-surface);
}

.btn-primary:hover {
    background-color: #143a2f;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-primary);
}

/* Header Styles */
.header {
    background-color: var(--color-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Softer, deeper shadow */
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--color-primary);
    /* Subtle top accent */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem var(--spacing-sm);
    min-height: 80px;
    /* Taller header for premium feel */
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.church-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    /* Equal spacing logic */
    flex-grow: 1;
    max-width: 900px;
    /* Constrain wide menus */
    margin-left: 2rem;
}

.nav-link {
    font-weight: 600;
    color: var(--color-text);
    padding: 0.5rem 0;
    position: relative;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Subtle Underline Animation */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
}

.mobile-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

/* Mobile Menu Backdrop */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-backdrop.active {
    display: block;
    opacity: 1;
}


/* Announcement Bar */
.announcement-bar {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    padding: 0.5rem 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    font-weight: 600;
    font-size: 0.9rem;
}

.announcement-content {
    display: inline-block;
    padding-left: 100%;
    animation: scroll-left 20s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    /* Adjust as needed */
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.4);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-surface);
    padding: 0 var(--spacing-sm);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-secondary);
    /* Gold text for title */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Welcome Section */
.welcome-section {
    background-color: var(--color-surface);
}

.vicar-card {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    background: var(--color-background);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.vicar-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--color-secondary);
}

/* Highlights Grid */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.highlight-card {
    background: var(--color-surface);
    padding: var(--spacing-md);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-fast);
    border-top: 4px solid var(--color-secondary);
}

.highlight-card:hover {
    transform: translateY(-5px);
}

.highlight-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

/* Footer (Basic structure) */
.footer {
    background-color: var(--color-primary);
    color: var(--color-surface);
    padding: var(--spacing-lg) 0 var(--spacing-md);
}


/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
}

/* Timeline Styles (for Vicars) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--color-secondary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--color-background);
    border: 4px solid var(--color-primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--color-surface);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--color-surface);
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--color-surface);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--color-surface) transparent transparent;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 20px;
    background-color: var(--color-surface);
    position: relative;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.vicar-timeline-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@media screen and (max-width: 600px) {
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::before {
        left: 60px;
        border: medium solid white;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }

    .left::after,
    .right::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }
}

/* Responsiveness */
@media (max-width: 1100px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        /* Slide in from right */
        width: 300px;
        height: 100vh;
        background-color: var(--color-surface);
        flex-direction: column;
        padding: 5rem 2rem;
        gap: 2rem;
        transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
        z-index: 999;
        margin-left: 0;
        justify-content: flex-start;
    }

    .nav-menu.active {
        right: 0;
    }

    .mobile-toggle {
        display: block;
        z-index: 1001;
    }

    .logo {
        max-width: 70%;
    }
}


/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-fast);
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform var(--transition-medium);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Contact Page Styles */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.contact-info-card {
    background: var(--color-surface);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    font-size: 1.2rem;
    color: var(--color-primary);
    width: 24px;
    text-align: center;
}

.map-container {
    width: 100%;
    height: 300px;
    background-color: #eee;
    margin-top: var(--spacing-md);
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}