/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    font-size: 16px; /* Ensure minimum readable font size */
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
}

.logo-text h2 {
    font-family: 'Playfair Display', serif;
    color: #2c5aa0;
    font-size: 1.5rem;
    margin-bottom: -5px;
}

.logo-text span {
    font-size: 0.9rem;
    color: #666;
    font-weight: 300;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #2c5aa0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2c5aa0;
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    border: none;
    background: transparent;
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.hamburger:hover {
    background: rgba(44, 90, 160, 0.1);
    border-radius: 8px;
}

.hamburger:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
    border-radius: 8px;
}

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Hamburger animation */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 20px 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero-content {
    flex: 1;
    max-width: 500px;
    padding-right: 30px;
}

.hero-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(44, 90, 160, 0.2);
    background: white;
    padding: 10px;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: #2c5aa0;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.hero-description {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.cta-button {
    display: inline-block;
    padding: 15px 30px;
    background: #2c5aa0;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
    border: none;
    cursor: pointer;
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px;
    font-size: 1rem;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cta-button:hover {
    background: #1e3f73;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.hero-image {
    flex: 1.2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    width: 100%;
    max-width: 600px;
    height: 550px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    padding: 80px 0;
    background: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 2rem;
    color: #555;
    line-height: 1.8;
}

.about-text ul {
    list-style: none;
    padding-left: 0;
}

.about-text li {
    margin-bottom: 1rem;
    color: #555;
    line-height: 1.8;
}

.about-text strong {
    color: #2c5aa0;
}

.external-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.external-links h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.wiki-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    color: #2c5aa0;
    text-decoration: none;
    border-radius: 10px;
    border: 2px solid #2c5aa0;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.wiki-link:hover {
    background: #2c5aa0;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* History Section */
.history {
    padding: 80px 0;
    background: #f8f9fa;
}

.history-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #2c5aa0;
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-year {
    flex: 0 0 100px;
    text-align: center;
    font-weight: 700;
    color: #2c5aa0;
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
}

.timeline-year::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 15px;
    height: 15px;
    background: #2c5aa0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid white;
}

.timeline-content {
    flex: 1;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 0 2rem;
}

.timeline-content h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: #555;
    line-height: 1.8;
}

/* Timings Section */
.timings {
    padding: 80px 0;
    background: white;
}

.timings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.timing-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.timing-card:hover {
    transform: translateY(-5px);
    border-color: #2c5aa0;
}

.timing-card h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5aa0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.time-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.time-slot:last-child {
    border-bottom: none;
}

.time {
    font-weight: 600;
    color: #2c5aa0;
    font-size: 1.1rem;
}

.language {
    color: #666;
    font-size: 0.9rem;
}

/* Gallery Section */
.gallery {
    padding: 80px 0;
    background: #f8f9fa;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 250px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5aa0;
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: #555;
    line-height: 1.8;
}

.map-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #2c5aa0;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.map-link:hover {
    background: #1e3f73;
}

.map-container {
    margin-top: 2rem;
}

.map-embed {
    margin-top: 1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.map-embed iframe {
    width: 100%;
    height: 250px;
    border: none;
}

.contact-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
}

.contact-form h3 {
    font-family: 'Playfair Display', serif;
    color: #2c5aa0;
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #2c5aa0;
}

.contact-form button {
    width: 100%;
    padding: 1rem;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contact-form button:hover {
    background: #1e3f73;
}

/* Footer */
.footer {
    background: #2c5aa0;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

/* Social Media Styles */
.social-media {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.social-link svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.social-link.facebook:hover {
    background: rgba(24, 119, 242, 0.2);
}

.social-link.instagram:hover {
    background: rgba(225, 48, 108, 0.2);
}

.social-link.youtube:hover {
    background: rgba(255, 0, 0, 0.2);
}

.social-link span {
    font-size: 0.9rem;
}

/* Responsive Design - Mobile First Approach */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 0 30px;
    }
    
    .hero-content {
        padding-right: 15px;
        max-width: 450px;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .nav-container {
        padding: 0 30px;
    }
    
    .hero-image img {
        max-width: 500px;
        height: 450px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 1rem;
        display: block;
        border-radius: 8px;
        margin: 0 2rem;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background: rgba(44, 90, 160, 0.1);
        color: #2c5aa0;
    }
    
    .hamburger {
        display: flex;
    }

    .hamburger.active + .nav-menu {
        left: 0;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 20px 40px;
        min-height: auto;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 2rem;
        max-width: 100%;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-image {
        max-width: 100%;
        margin-top: 2rem;
    }
    
    .hero-image img {
        max-width: 100%;
        height: 350px;
        object-fit: cover;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .timeline-item {
        flex-direction: column !important;
        text-align: center;
        padding: 1.5rem;
    }
    
    .timeline-content {
        margin: 1rem 0 0 0;
    }
    
    .history-timeline::before {
        left: 20px;
    }
    
    .timeline-year::before {
        left: 20px;
    }
    
    .timings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .section-header h2 {
        font-size: 2.5rem;
    }
    
    .cta-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .nav-container {
        height: 70px;
        padding: 0 20px;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .logo-text h2 {
        font-size: 1.3rem;
    }
    
    .logo-text span {
        font-size: 0.8rem;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        height: 60px;
        padding: 0 15px;
    }
    
    .logo-img {
        width: 35px;
        height: 35px;
    }
    
    .logo-text h2 {
        font-size: 1.1rem;
    }
    
    .logo-text span {
        font-size: 0.7rem;
    }
    
    .hamburger {
        width: 20px;
    }
    
    .bar {
        width: 20px;
        height: 2px;
    }
    
    .hero {
        padding: 80px 15px 30px;
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .hero-logo-img {
        width: 80px;
        height: 80px;
    }
    
    .section-header h2 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .section-header p {
        font-size: 0.9rem;
    }
    
    .about-text h3 {
        font-size: 1.3rem;
    }
    
    .about-text p,
    .about-text li {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .timeline-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .timeline-year {
        font-size: 1.2rem;
    }
    
    .timeline-content h3 {
        font-size: 1.1rem;
    }
    
    .timeline-content p {
        font-size: 0.85rem;
    }
    
    .timing-card {
        padding: 1rem;
    }
    
    .timing-card h3 {
        font-size: 1.1rem;
    }
    
    .timing-card p {
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .contact-info h3 {
        font-size: 1.2rem;
    }
    
    .contact-info p {
        font-size: 0.9rem;
    }
    
    .social-links {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .social-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
        padding: 1rem 0;
    }
    
    .nav-link {
        font-size: 1rem;
        margin: 0 1rem;
        padding: 0.8rem;
    }
}

/* Extra small devices */
@media (max-width: 320px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .nav-container {
        padding: 0 10px;
    }
    
    .hero-logo-img {
        width: 60px;
        height: 60px;
    }
    
    .logo-text h2 {
        font-size: 1rem;
    }
    
    .timing-card,
    .timeline-item {
        padding: 0.8rem;
    }
    
    .hero-image img {
        height: 200px;
        max-width: 100%;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Improve image loading and performance */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link:hover,
    .cta-button {
        outline: 2px solid currentColor;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* This can be expanded later if dark mode is desired */
}

/* Focus management for keyboard navigation */
*:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.nav-link:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Ensure sufficient color contrast */
.hero-description,
.about-text p {
    color: #444; /* Improved contrast */
}

/* Loading optimization */
.hero-image img,
.gallery-item img {
    object-fit: cover;
    object-position: center;
    /* Add loading="lazy" to HTML img tags for performance */
}

/* Animation for elements coming into view */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

/* Placeholder for images - you can replace these with actual images */
img[src*="church-main.jpg"],
img[src*="church-interior.jpg"],
img[src*="church-exterior.jpg"],
img[src*="altar.jpg"],
img[src*="stained-glass.jpg"],
img[src*="christmas-mass.jpg"],
img[src*="youth-group.jpg"],
img[src*="community-service.jpg"] {
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

img[src*="church-main.jpg"]::before { content: "Main Church Image"; }
img[src*="church-interior.jpg"]::before { content: "Church Interior"; }
img[src*="church-exterior.jpg"]::before { content: "Church Exterior"; }
img[src*="altar.jpg"]::before { content: "Main Altar"; }
img[src*="stained-glass.jpg"]::before { content: "Stained Glass"; }
img[src*="christmas-mass.jpg"]::before { content: "Christmas Mass"; }
img[src*="youth-group.jpg"]::before { content: "Youth Group"; }
img[src*="community-service.jpg"]::before { content: "Community Service"; }
