/* Root Variables */
:root {
    --primary-color: #002a5c; /* Ajax dark blue */
    --secondary-color: #ffffff; /* White */
    --accent-color: #f8c73f; /* Gold accent for highlights */
    --text-color: #333333;
    --light-gray: #f5f5f5;
    --medium-gray: #dddddd;
    --dark-gray: #666666;
    --header-height: 80px;
    --transition-speed: 0.3s;
    --section-padding: 60px 0; /* Adjusted padding */
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* JS handles smooth scroll with offset now */
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
    background-color: var(--secondary-color); /* Ensure body has a bg color */
}

.container {
    width: 90%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}
a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px; /* Softer default radius */
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 50px; /* Increased margin */
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
}

/* Header Styles */
.main-header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
    height: var(--header-height);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%; /* Take full height of main-header */
    padding: 0 30px;
}

.logo-container .town-logo {
    height: 60px;
    border-radius: 10px;
    transition: transform var(--transition-speed);
}
.logo-container .town-logo:hover {
    transform: scale(1.05);
}

.main-nav ul {
    display: flex;
}
.main-nav li {
    margin-left: 30px;
}
.main-nav a {
    font-weight: 600;
    position: relative;
    color: var(--secondary-color); /* Ensure nav links are white */
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color); /* Accent color for hover */
    transition: width var(--transition-speed);
}
.main-nav a:hover::after, .main-nav a.active::after { /* Active link style */
    width: 100%;
}
.main-nav a:hover {
    color: var(--accent-color); /* Hover color for link text */
}

/* Hero Section */
.hero-section {
    min-height: calc(100vh - var(--header-height)); /* Adjust for header height */
    padding-top: var(--header-height); /* Offset for fixed header */
    background: linear-gradient(rgba(0, 42, 92, 0.75), rgba(0, 42, 92, 0.85)), 
                url('70th Anniversary/Waterfront W9.jpg') no-repeat center center/cover;
    color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 20px;
    animation: fadeIn 1.5s ease-out;
}

.anniversary-logo {
    max-width: 250px; /* Slightly smaller */
    margin-bottom: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.hero-content h1 {
    font-size: 3.5rem; /* Adjusted size */
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.15rem; /* Adjusted size */
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.hero-button:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    font-size: 1.5rem;
    color: var(--secondary-color); /* Ensure visibility */
    animation: bounce 2s infinite;
    cursor: pointer;
}

/* About Section */
.about-section {
    padding: var(--section-padding);
    background-color: var(--secondary-color); 
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: flex-start; 
}

.about-text {
    flex: 2; 
}
.about-text p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}
.about-text .inline-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: underline;
}
.about-text .inline-link:hover {
    color: var(--accent-color);
}
.about-text .note {
    font-style: italic;
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--light-gray);
}

.about-img {
    flex: 1;
    text-align: center;
}
.about-img img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.img-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--dark-gray);
}
.img-citation {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--dark-gray);
    text-align: left; /* Or center if preferred */
}

/* Timeline Section */
.new-timeline-section {
    padding: var(--section-padding);
    background-color: var(--light-gray);
}

.timeline-wrapper {
    position: relative;
    max-width: 1500px; 
    margin: 0 auto;
}
.timeline-wrapper::before {
    content: '';
    position: absolute;
    left: 30px; 
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--medium-gray);
    border-radius: 2px;
}

.timeline-event-item {
    margin-bottom: 45px;
    position: relative;
    padding-left: 70px; 
}

.timeline-event-item.landmark-event .timeline-event-year-badge {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translate(-50%, -50%) scale(1.2);
    top: 30px;
}
.timeline-event-item.landmark-event .timeline-event-details {
    border-left-color: var(--accent-color);
}

.timeline-event-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.timeline-event-year-badge {
    position: absolute;
    left: 30px; 
    top: 0; 
    transform: translate(-50%, 10px); 
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.0rem;
    z-index: 1;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-event-title-clickable {
    font-size: 1.7rem;
    color: var(--primary-color);
    margin: 0;
    padding: 10px;
    flex-grow: 1;
}
.timeline-event-title-clickable:hover {
    color: var(--accent-color);
}
.timeline-event-title-clickable .expand-icon {
    margin-left: 10px;
    font-size: 0.9em;
    transition: transform var(--transition-speed);
}

.timeline-event-details {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--primary-color);
}
.timeline-event-details p {
    margin-bottom: 15px;
    font-size: 2.1rem;
}
.timeline-event-image {
    max-width: 100%;
    max-height: 350px; 
    object-fit: contain; 
    margin: 15px auto; 
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-video-embed {
    margin: 20px 0;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}
.timeline-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.timeline-flippable-embed {
    margin: 20px 0;
}
.timeline-flippable-embed h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 10px;
}
.timeline-flippable-embed iframe {
    width: 100%;
    height: 800px; /* Adjust as needed */
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
}

.timeline-brochure-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--light-gray);
}
.timeline-brochure-links h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 10px;
}
.timeline-brochure-links ul {
    list-style: disc;
    margin-left: 20px;
}
.timeline-brochure-links ul li {
    margin-bottom: 8px;
}
.timeline-doc-link {
    display: inline-block;
    padding: 3px 0px;
    font-size: 0.95rem;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    text-decoration: underline;
}

/* Gallery Section */
.gallery-section {
    padding: var(--section-padding);
    background-color: var(--secondary-color);
}

.gallery-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
    gap: 10px;
}

.filter-button {
    padding: 8px 20px;
    background-color: var(--light-gray);
    color: var(--text-color); 
    border: 1px solid var(--medium-gray); 
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 500;
}
.filter-button:hover {
    background-color: var(--medium-gray);
}
.filter-button.active {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    height: 350px;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}
.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--secondary-color);
    padding: 15px;
    transform: translateY(100%);
    transition: transform var(--transition-speed);
    font-size: 0.9rem;
}
.gallery-item:hover .gallery-item-caption {
    transform: translateY(0);
}

/* Gallery Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none; 
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}
.gallery-modal.active {
    display: flex;
    opacity: 1;
}
.gallery-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--secondary-color);
    font-size: 2.5rem; 
    cursor: pointer;
    z-index: 2001;
}
.gallery-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    display: flex; 
    flex-direction: column;
    align-items: center;
}
#modal-image {
    max-width: 100%;
    max-height: 80vh; 
    display: block;
    margin: 0 auto; 
    border-radius: 4px;
    object-fit: contain; 
}
.modal-caption {
    color: var(--secondary-color);
    text-align: center;
    margin-top: 15px; 
    padding: 0 20px; 
    font-size: 1rem;
}
.modal-navigation {
    margin-top: 20px; 
    display: flex;
    justify-content: center;
    gap: 20px;
}
.modal-prev, .modal-next {
    background-color: rgba(255, 255, 255, 0.2); 
    border: none;
    color: var(--secondary-color);
    width: 45px; 
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 1.2rem;
}
.modal-prev:hover, .modal-next:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* End Message Section */
.end-message-section {
    padding: var(--section-padding);
    background-color: var(--light-gray);
    text-align: center;
}
.end-message-section p {
    margin-bottom: 15px;
    font-size: 1.05rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.end-message-section .inline-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: underline;
}
.end-message-section .inline-link:hover {
    color: var(--accent-color);
}

/* Footer Styles */
.new-footer-style {
    background-color: var(--primary-color);
    color: #c5d4e8; /* Lighter blue-gray for text */
    padding: 50px 0 20px;
    font-size: 0.95rem;
}

.footer-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h4 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.footer-toa-logo {
    height: 30px; /* Adjust size as needed */
    margin-right: 10px;
    filter: brightness(0) invert(1); /* Makes PNG logo white */
}

.footer-column p, .footer-column ul li {
    margin-bottom: 10px;
    line-height: 1.7;
}
.footer-column ul {
    padding-left: 0;
}
.footer-column a {
    color: #c5d4e8;
}
.footer-column a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}
.footer-column i.fas, .footer-column i.fab { /* Icons in contact info */
    margin-right: 8px;
    color: var(--accent-color);
    width: 20px; /* Align icons */
    text-align: center;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.footer-social .social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--secondary-color);
    font-size: 1.1rem;
    transition: all var(--transition-speed);
}
.footer-social .social-icon:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
    color: #a9b8cc; /* Slightly dimmer for copyright */
}
.footer-bottom p {
    margin-bottom: 5px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .section-title { font-size: 2.2rem; }
    .hero-content h1 { font-size: 3rem; }
    
    .about-content {
        flex-direction: column;
    }
    .about-text, .about-img {
        flex: none;
        width: 100%;
    }
    .about-img img { max-width: 80%; margin: 0 auto; }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root { --header-height: auto; /* Allow header to wrap */ }
    .main-header { height: auto; }
    .header-content {
        flex-direction: column;
        padding: 15px;
        height: auto;
    }
    .logo-container { margin-bottom: 10px; }
    .main-nav ul {
        flex-direction: column;
        text-align: center;
        margin-top: 10px;
    }
    .main-nav li {
        margin: 8px 0;
    }

    .hero-section { min-height: auto; padding-top: 100px; } 
    .hero-content h1 { font-size: 2.5rem; }
    .section-title { font-size: 2rem; }
    
    .timeline-wrapper::before { left: 20px; } 
    .timeline-event-item { padding-left: 45px; } 
    .timeline-event-year-badge {
        left: 20px;
        padding: 6px 10px;
        font-size: 0.8rem;
        transform: translate(-50%, 5px);
    }
    .timeline-event-title-clickable { font-size: 1.3rem; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    
    .footer-content-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-column h4 { justify-content: center; }
    .footer-social { justify-content: center; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }
    .anniversary-logo { max-width: 180px; }

    .timeline-event-title-clickable { font-size: 1.1rem; }
    .timeline-event-details { padding: 15px; }
    
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item { height: 200px; }
}


.timeline-event-image {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    margin: 15px auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer; /* Add this line */
}

