.hero {
    position: relative;
    height: 70vh;
    background: url('https://stpeterschurchkuching.org/media/page_asset/our_history.jpg') no-repeat center center/cover;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2));
}

.hero-content {
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.section-title {
    font-weight: 700;
    padding-bottom: 1rem;
    border-bottom: 3px solid #0d6efd;
    display: inline-block;
    margin-bottom: 2.5rem;
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important;
}

.gallery-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 0.5rem;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 4rem;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 4rem;
}

.timeline-dot {
    content: '';
    position: absolute;
    top: 1.5rem;
    width: 20px;
    height: 20px;
    background-color: #0d6efd;
    border: 4px solid #f8f9fa;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15) !important;
}

.timeline-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    /* Changed from 'cover' to 'contain' to prevent cropping */
    margin-bottom: 1rem;
    border-radius: .25rem;
    background-color: #e9ecef;
    /* Added a background color to frame the image */
}

.footer {
    background-color: #343a40;
}

.arch-img {
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15) !important;
    object-fit: cover;
}

.arch-img-main {
    height: 400px;
}

.arch-img-sub {
    height: 180px;
}


/* Mobile-Friendly Adjustments */
@media (max-width: 767.98px) {
    .hero {
        height: 50vh;
        /* Reduce height on mobile */
    }

    .hero-content h1 {
        font-size: 2.5rem;
        /* Reduce font size on mobile */
    }

    .timeline::before {
        left: 10px;
        /* Move timeline to the left */
        transform: translateX(0);
    }

    .timeline-item {
        width: 100%;
        padding-right: 15px;
        margin-bottom: 1.5rem;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
        /* Align all text to the left */
        padding-left: 40px;
    }

    .timeline-dot {
        top: 1.5rem;
    }

    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 0;
        /* Position all dots on the left line */
    }
}