@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Lora:wght@400;700&display=swap');

/* --- CSS Custom Properties (Theme) --- */
:root {
    --primary-color: #7B1113; /* Warm Burgundy */
    --secondary-color: #D4C0A1; /* Pale Gold / Beige */
    --text-color: #333333; /* Charcoal */
    --text-light: #555;
    --bg-light: #F8F6F2; /* Warm Off-white */
    --bg-white: #ffffff;
    --border-color: #ddd;
    --header-height: 84px;
}

/* --- Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

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

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', serif;
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 0;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 2.5rem; margin-bottom: 30px; }
h3 { font-size: 1.8rem; margin-bottom: 15px; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }

img {
    max-width: 100%;
    height: auto;
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 40px 0;
}

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

.content-section {
    padding: 80px 20px;
    text-align: center;
}
.content-section.bg-white {
    background-color: var(--bg-white);
}

.main-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.primary-btn {
    display: inline-block;
    margin-top: 20px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}
.primary-btn:hover {
    background-color: #5E0D0F; /* Darker Burgundy */
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- STYLISH CTA LINK --- */
.cta-link {
    display: inline-block;
    margin-top: 10px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

.cta-link::after {
    content: ' →'; /* Adds the arrow */
    transition: transform 0.3s ease;
    display: inline-block; /* Allows transformation */
}

.cta-link:hover {
    color: var(--text-color); /* A simple color change on hover */
}

.cta-link:hover::after {
    transform: translateX(5px); /* Move the arrow slightly on hover */
}

/* --- Header & Navigation --- */
header {
    background-color: var(--bg-white);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Added flex-grow to allow shrinking */
    flex-grow: 1; 
}
.logo-container img {
    height: 60px;
    flex-shrink: 0; /* Prevent logo from shrinking */
}
.logo-container .logo-text h1 {
    margin: 0;
    font-size: 1.4rem; 
    color: var(--primary-color);
    line-height: 1.2;
}
.logo-container .logo-text p {
    margin: 0;
    font-size: 1em; 
    color: var(--text-light);
}
.logo-container a {
    text-decoration: none;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
    font-size: 1.1em;
    flex-shrink: 0; /* Prevent nav from shrinking */
}
.nav-links li {
    position: relative; /* For dropdown positioning */
}
.nav-links a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px 0;
    font-weight: bold;
    position: relative;
    display: inline-block;
}
/* Modern underline effect */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* --- DROPDOWN STYLES --- */
.nav-item-dropdown .dropdown-toggle::after {
    content: ' ▼'; /* Simple dropdown arrow */
    font-size: 0.7em;
    margin-left: 4px;
}
.nav-item-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-white);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 180px;
    border-radius: 0 0 8px 8px;
    border-top: 3px solid var(--secondary-color);
    z-index: 1001;
}
.nav-item-dropdown:hover .dropdown-menu {
    display: block;
}
.nav-item-dropdown .dropdown-menu a {
    padding: 10px 20px;
    font-weight: normal;
    font-size: 1rem;
    display: block; /* Make the whole area clickable */
    white-space: nowrap;
}
/* Make dropdown links not have the underline effect */
.nav-item-dropdown .dropdown-menu a::after {
    display: none;
}
.nav-item-dropdown .dropdown-menu a:hover {
    background-color: var(--bg-light);
}

/* --- Mobile Menu Toggle (Hamburger) --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0; /* Prevent menu icon from shrinking */
}
.menu-toggle .bar {
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    text-align: center;
    color: #fff;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url(Church.jpg);
    background-size: cover;
    background-position: center;
    height: 85vh; /* Taller for more impact */
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.hero-content {
    width: 100%;
    max-width: 800px;
    animation: fadeIn 1s ease-in-out;
}
.hero-content h2 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 20px;
    color: #fff;
}
.hero-content p {
    font-size: 1.25rem;
    margin: 0 auto 30px;
    max-width: 600px;
}
.hero-buttons a {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 15px 30px;
    text-decoration: none;
    font-size: 1.1em;
    margin: 8px;
    border-radius: 8px;
    display: inline-block;
    font-weight: bold;
    border: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
}
.hero-buttons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.hero-buttons a.secondary {
    background-color: transparent;
    border: 2px solid #fff;
    color: #fff;
}
.hero-buttons a.secondary:hover {
    background-color: #fff;
    color: var(--text-color);
}

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

/* --- Flexible Card/Item Layout --- */
.flex-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Base card style for events & ministries */
.card {
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden; /* For images in ministry cards */
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* --- Event Cards --- */
.event-card {
    flex: 1 1 300px; /* Responsive flex property */
    max-width: 350px;
    padding: 25px;
    border: 1px solid var(--border-color);
    text-align: left;
}
.event-card .date-month {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0;
    font-family: 'Lora', serif;
    font-weight: 700;
}
.event-card .date-day {
    font-size: 3rem;
    font-weight: 700;
    margin: -5px 0 10px;
    color: var(--text-color);
    font-family: 'Lora', serif;
}
.event-card h5 {
    font-size: 1.3rem;
    margin: 10px 0;
}
.event-card p {
    margin-bottom: 0;
}

/* --- Ministry Cards --- */
.ministry-card {
    flex: 1 1 300px; /* Responsive flex property */
    max-width: 350px;
    text-align: center;
}
.ministry-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.ministry-card-content {
    padding: 20px 25px;
}
.ministry-card h5 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}
.ministry-card p {
    margin-bottom: 0;
    color: var(--text-light);
}

/* --- About Section --- */
.vicar-message {
    padding: 20px 0;
    background-color: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 40px;
    text-align: left;
    flex-wrap: wrap;
    justify-content: center;
}
/* MODERNIZED VICAR PHOTO */
.vicar-message img {
    width: 300px;
    height: auto;
    border-radius: 12px; /* Modern rounded rectangle */
    object-fit: cover;
    border: 6px solid var(--secondary-color);
    flex-shrink: 0;
}
.vicar-message blockquote {
    margin: 0;
    max-width: 600px;
    font-size: 1.15rem;
    font-style: italic;
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
}
.vicar-message blockquote p {
    margin-bottom: 15px;
}
.vicar-message cite {
    font-style: normal;
    font-weight: bold;
    color: var(--text-color);
}

.committee-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    font-size: 1.05rem;
}
.committee-table th, .committee-table td {
    border: 1px solid var(--border-color);
    padding: 14px;
    text-align: left;
}
.committee-table th {
    background-color: var(--primary-color);
    color: #fff;
    font-family: 'Lora', serif;
}
.committee-table tr:nth-child(even) {
    background-color: var(--bg-light);
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}
.gallery-container img {
    width: 100%;
    max-width: 280px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
}
.gallery-container img:hover {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

/* --- ALBUM CARD STYLE --- */
.album-card {
    flex: 1 1 300px; /* Responsive flex property */
    max-width: 350px;
    text-align: center;
    display: block;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 12px;
    overflow: hidden; /* For the image */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}
.album-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.album-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
.album-card-content {
    padding: 20px 25px;
    background-color: var(--bg-white);
}
.album-card h5 {
    font-size: 1.4rem;
    margin: 0;
    color: var(--primary-color);
}

/* --- Contact Section --- */
#contact .flex-container {
    align-items: flex-start;
}
.flex-item {
    flex-basis: 45%;
    min-width: 300px;
    text-align: left;
}
.contact-form {
    max-width: 100%;
    margin: 0;
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(128,0,0,0.3);
}
.contact-form button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.contact-form button:hover {
    background-color: #5E0D0F; /* Darker Burgundy */
}
.map-container {
    margin-top: 40px;
    border: 6px solid var(--secondary-color);
    border-radius: 12px;
    overflow: hidden;
    line-height: 0; /* Fix iframe bottom space */
}

/* --- Google Calendar Embed --- */
.calendar-container {
    position: relative;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.calendar-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Footer --- */
footer {
    background-color: #343a40;
    color: #fff;
    padding: 50px 20px;
}
.footer-container {
    display: flex;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}
.footer-container div {
    min-width: 250px;
    flex: 1 1 250px;
    text-align: left;
}
.footer-container h5 {
    font-family: 'Lora', serif;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    color: #fff;
    font-size: 1.25rem;
}
.footer-container a {
    color: #fff;
    transition: all 0.3s ease;
}
.footer-container a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}
.social-icons a {
    display: inline-block;
    margin-right: 15px;
}
.social-icons a:hover {
    transform: scale(1.1);
    padding-left: 0;
}
.social-icons svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
    fill: none;
    transition: stroke 0.3s ease;
}
.social-icons a:hover svg {
    stroke: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #555;
    padding-top: 30px;
    font-size: 0.9rem;
    color: #ccc;
}

/* --- GALLERY PAGE STYLES --- */
.gallery-header {
    padding: 40px 20px;
    text-align: center;
    background-color: #fff;
    border-bottom: 4px solid var(--primary-color);
}
.gallery-header h1 {
    font-family: 'Lora', serif;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin: 0 0 10px;
}
.back-link {
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1rem;
}
.back-link:hover {
    color: var(--text-color);
}
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.gallery-grid img {
    width: 100%;
    max-width: 350px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
}
.gallery-grid img:hover {
    border-color: var(--secondary-color);
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- OPTIMIZED Responsive Design --- */

/* == 1. Tablet & Mobile Navigation Breakpoint == */
/* Triggers the hamburger menu */
@media (max-width: 992px) {
    .logo-container .logo-text h1 {
        font-size: 1.1rem; 
    }
    .logo-container img {
        height: 50px;
    }
    
    /* --- Mobile Navigation --- */
    .menu-toggle {
        display: flex;
        z-index: 1002;
    }

    .nav-links {
        display: none; /* Hide by default */
        flex-direction: column;
        position: fixed; /* Full-screen overlay */
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(5px);
        justify-content: center;
        align-items: center;
        gap: 30px;
        z-index: 1001;
    }
    .nav-links.active {
        display: flex; /* Show when active */
    }
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        font-size: 1.8rem;
    }
    .nav-links a::after {
        height: 4px;
    }

    /* Dropdown styles for mobile menu */
    .nav-item-dropdown .dropdown-toggle::after {
        display: inline-block; /* Keep the arrow */
    }
    .nav-item-dropdown .dropdown-menu {
        position: static;
        display: block; /* Always show subdirectory in mobile list */
        background-color: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-left: 20px; /* Indent history link */
        margin-top: -15px; /* Pull it closer to parent */
    }
    .nav-item-dropdown .dropdown-menu a {
        font-size: 1.5rem; /* A bit smaller than main links */
        color: var(--text-light);
        padding: 5px 20px;
    }
    
    /* Animate hamburger to 'X' */
    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero-content {
        padding-top: 60px; /* Add space for header */
    }
    
    .footer-container {
        text-align: center;
    }
    .footer-container div {
        text-align: center;
    }
}

/* == 2. Portrait Tablet & Large Phone Breakpoint == */
/* Stacks content for better vertical reading */
@media (max-width: 768px) {
    h2 { font-size: 2.2rem; }
    h3 { font-size: 1.6rem; }
    
    .content-section {
        padding: 60px 20px;
    }

    /* --- UPDATED MOBILE HEADER --- */
    header {
        flex-wrap: wrap;
        justify-content: center; /* Center the logo */
        padding-bottom: 10px;
        /* Increase min-height to ensure it doesn't look cramped */
        min-height: var(--header-height); 
    }
    .logo-container {
        flex-basis: 100%; /* Make logo block take full width */
        justify-content: center; /* Center its content */
        margin-bottom: 10px; /* Space below logo block */
        padding-right: 40px; /* Add space to avoid hamburger */
    }
    .logo-container .logo-text {
        text-align: center; /* Center-align the text */
    }
    .logo-container img {
        height: 50px; /* Slightly smaller logo on mobile */
    }
    .menu-toggle {
        /* Position the menu icon absolutely to the top right */
        position: absolute;
        top: 0;
        bottom: 0;
        margin: auto 0; /* Vertically center */
        right: 20px;
        height: 24px; /* Explicit height */
    }
    .nav-links {
        gap: 20px; /* Reduce gap for mobile nav */
    }
    /* --- END UPDATED MOBILE HEADER --- */


    /* Stack contact form */
    .flex-item {
        flex-basis: 100%;
    }

    /* Stack vicar photo */
    .vicar-message {
        flex-direction: column;
    }
    .vicar-message img {
        width: 100%;
        max-width: 300px; /* Stop it from being huge */
        height: auto;
    }

    /* *** NEW MOBILE COMMITTEE LIST *** */
    /* This turns the table into a list of cards */
    .committee-table {
        border: none; /* Remove table border */
    }
    .committee-table thead {
        display: none; /* Hide headers */
    }
    .committee-table tr {
        display: block; /* Stack rows */
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        background-color: var(--bg-white);
    }
    .committee-table td {
        display: block; /* Stack cells */
        padding: 5px 0;
        border: none;
        text-align: left; /* Ensure text is left-aligned */
    }
    .committee-table td:first-child {
        font-weight: bold;
        color: var(--primary-color); /* Use the theme color */
        font-size: 1.1rem;
    }
    /* *** END NEW MOBILE COMMITTEE LIST *** */
}


/* == 3. Small Phone Breakpoint == */
/* Adjusts for the smallest screens */
@media (max-width: 380px) {
    h2 { font-size: 2rem; }
    
    .hero-content h2 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    /* Stack hero buttons */
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .hero-buttons a {
        margin: 0;
    }
    
    .content-section {
        padding: 50px 20px;
    }
        
    .gallery-header h1 { font-size: 2rem; }
    .gallery-grid img { max-width: 100%; }
}
/* --- SECURITY: HONEY TRAP FIX --- */
/* Completely invisible to humans, effective against bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
