.hero {
    height: 89vh;
    width: 100%;
    margin: 10px auto;
    background: url('heroPic.png') no-repeat center center/cover;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    padding: 0 40px;
    z-index: 2;
}

.hero-content-wrapper {
    width: 100%;
    max-width: 750px;
    height: auto;
    animation: heroTextFadeUp 2.0s forwards;
    background: rgb(255, 255, 255);
    border: 1px solid rgba(32, 58, 108, 1);
    padding: 40px;
    border-radius: 20px;
}

.hero-overlay h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 15px;
    color: #203a6c;
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero-overlay h1 span {
    display: inline;
}

.hero-overlay h1 span span {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

.hero-overlay h1 span span:hover {
    transform: scale(1.2);
    color: #ccd3de;
}

.hero-subtext {
    font-size: 1.1rem;
    color: #203a6c;
    line-height: 1.6;
}

@keyframes heroTextFadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    background-color: #ffffff;
    margin: 0 auto;
    padding: 60px 40px;
    position: relative;
    z-index: 2;
    color: #434656;
}

.scroll-animate {
    opacity: 0;
    transform: translateY(60px) scale(0.96);
    will-change: opacity, transform;
}

.feature-cards {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 60px;
    width: 100%;
}

.card {
    flex: 1;
    height: 65vh;
    min-height: 500px;
    perspective: 1000px;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.card.slide-in {
    opacity: 1;
    transform: translateX(0);
}

.card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 12px;
    cursor: pointer;
}

.card:hover .card-flipper {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.card-front::after,
.card-back::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(32, 58, 108, 0.65);
    pointer-events: none;
    z-index: 1;
}

.card-front {
    z-index: 2;
}

.card-back {
    transform: rotateY(180deg);
}

.visit-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.card-opfair .card-front {
    background-image: url('opfairBannerFront.png');
}

.card-opfair .card-back {
    background-image: url('opfairBannerBack.png');
}

.card-events .card-front {
    background-image: url('eventBannerFront.png');
}

.card-events .card-back {
    background-image: url('eventBannerBack.jpeg');
}

.card-about .card-front {
    background-image: url('aboutBannerFront.png');
}

.card-about .card-back {
    background-image: url('aboutBannerBack.png');
}

.card.card-opfair.slide-in {
    transition-delay: 0s;
}

.card.card-events.slide-in {
    transition-delay: 0.15s;
}

.card.card-about.slide-in {
    transition-delay: 0.3s;
}

.card-inner {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 40px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: #ffffff;
    z-index: 3;
}

.opfair-back-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.card-subtext {
    font-size: 1rem;
    color: #ccd3de;
    font-weight: 400;
    line-height: 1.4;
}

.visit-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.card .arrow {
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.card-back:hover .arrow {
    transform: translateX(5px);
}

.calendar-image-row {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: stretch;
}

.calendar-wrapper,
.image-column-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calendar-wrapper h3,
.image-column-container h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: #203a6c;
    transition: color 0.3s ease;
}

.events-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    flex: 1;
}

.custom-event-card {
    display: flex;
    align-items: center;
    background-color: #203a6c;
    border-radius: 10px;
    padding: 16px 20px;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-event-card:hover {
    transform: translateY(-2px);
    background-color: #284785;
}

.event-date-box {
    background-color: #ffffff;
    color: #203a6c;
    min-width: 55px;
    height: 55px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px;
    margin-right: 20px;
}

.event-day {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.event-mon {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

.event-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.event-category {
    font-size: 0.75rem;
    color: #ccd3de;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.event-time {
    font-size: 0.85rem;
    color: #ccd3de;
}

.event-arrow {
    font-size: 1.8rem;
    color: #ccd3de;
    padding-left: 15px;
    font-weight: 300;
}

.event-loading {
    padding: 30px;
    text-align: center;
    color: #8494ae;
    font-size: 0.95rem;
    background-color: #f8fafc;
    border-radius: 10px;
    border: 1px solid #ccd3de;
}

.upcoming-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    flex: 1;
    min-height: 320px;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
    text-decoration: none;
}

.upcoming-image {
    flex: 0 0 45%;
    background-size: cover;
    background-position: center;
}

.upcoming-content {
    flex: 1;
    background-color: #203a6c;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 24px 28px;
    color: #ffffff;
}

.upcoming-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.upcoming-tagline {
    font-size: 0.95rem;
    color: #ccd3de;
    margin: 0;
}

.upcoming-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 4px;
}

.upcoming-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.upcoming-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #203a6c;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
}

.upcoming-cta:hover {
    transform: translateX(3px);
    background-color: #ccd3de;
}

.upcoming-cta .arrow {
    transition: transform 0.2s ease;
}

.gallery-section {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 20px 0 60px 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.gallery-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #203a6c;
    margin-bottom: 24px;
    padding-left: 0;
    text-align: left;
    transition: color 0.3s ease;
}

.gallery-marquee-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
    display: flex;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.gallery-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: galleryScroll 40s linear infinite;
    padding: 10px 0;
}

.gallery-marquee-container:hover .gallery-track {
    animation-play-state: paused;
}

.gallery-item {
    flex: 0 0 380px;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    background-color: #ffffff;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

@keyframes galleryScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.contact-section {
    border-top: 1px solid #ccd3de;
    padding-top: 50px;
    transition: border-color 0.3s ease;
}

.contact-container {
    display: flex;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    background-color: #f8f9fc;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.contact-left {
    flex: 1;
    padding: 50px;
    background-color: #203a6c;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-left h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.contact-left p {
    color: #ccd3de;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.copy-email {
    cursor: pointer;
}

.copy-email:hover {
    color: #ffffff;
    text-decoration: underline;
}

.social-links-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: #ffffff;
}

.social-card:hover {
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.social-card i {
    font-size: 1.8rem;
    width: 35px;
    text-align: center;
}

.social-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

.social-card p {
    font-size: 0.8rem;
    color: #8494ae;
    margin: 0;
}

.contact-right {
    flex: 1.2;
    padding: 50px;
    background-color: #ffffff;
}

.contact-form h2 {
    font-size: 1.8rem;
    color: #203a6c;
    margin-bottom: 25px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #434656;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1e293b;
    background-color: #f8fafc;
    outline: none;
    box-sizing: border-box;
}

.form-group textarea {
    resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #203a6c;
    background-color: #ffffff;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #203a6c;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:hover {
    background-color: #284785;
}

.success-message {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.success-message i {
    font-size: 3.5rem;
    color: #28a745;
    margin-bottom: 20px;
}

.success-message h2 {
    font-size: 1.8rem;
    color: #203a6c;
    margin-bottom: 15px;
    font-weight: 600;
}

.success-message p {
    color: #434656;
    font-size: 1rem;
    line-height: 1.5;
}

body.dark-mode .success-message h2 {
    color: #ffffff;
}

body.dark-mode .success-message p {
    color: #ccd3de;
}

body.dark-mode .hero {
    background: url('heroPicDark.png') no-repeat center center;
    background-size: cover;
}

body.dark-mode .hero-content-wrapper {
    background: rgb(0, 0, 0);
    border: 1px solid rgba(32, 58, 108, 1);
}

body.dark-mode .main-content {
    background-color: #000000;
    color: #ccd3de;
}

body.dark-mode .calendar-wrapper h3,
body.dark-mode .image-column-container h3 {
    color: #ccd3de;
}

body.dark-mode .event-loading {
    background-color: #121212;
    border-color: #384f75;
    color: #ccd3de;
}

body.dark-mode .gallery-section h3 {
    color: #ffffff;
}

body.dark-mode .gallery-item {
    background-color: #1a1a1a;
}

body.dark-mode .contact-section {
    border-top-color: #384f75;
}

body.dark-mode .contact-container {
    background-color: #121212;
    border-color: #384f75;
}

body.dark-mode .contact-right {
    background-color: #121212;
}

body.dark-mode .contact-form h2 {
    color: #ffffff;
}

body.dark-mode .form-group label {
    color: #ccd3de;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background-color: #1e1e1e;
    border-color: #384f75;
    color: #ffffff;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #8494ae;
}

@media (max-width: 1024px) {
    .hero-content-wrapper {
        max-width: 70vw;
    }
}

@media (max-width: 900px) {
    .hero-overlay {
        padding-left: 15px;
        padding-right: 15px;
        justify-content: center;
        text-align: center;
    }

    .hero-content-wrapper {
        max-width: 95vw;
        padding: 25px 20px;
    }

    .hero-overlay h1 {
        font-size: 2.1rem;
    }

    .main-content {
        padding: 40px 20px;
    }

    .feature-cards {
        flex-direction: column;
        gap: 20px;
    }

    .card {
        flex: none;
        height: 420px;
        min-height: auto;
    }

    .calendar-image-row {
        flex-direction: column;
        gap: 40px;
    }

    .upcoming-card {
        flex-direction: column;
    }

    .upcoming-image {
        flex: 0 0 45%;
    }

    .upcoming-content {
        padding: 20px;
    }

    .contact-container {
        flex-direction: column;
    }

    .contact-left, 
    .contact-right {
        padding: 30px 20px;
    }
}

@media (max-width: 600px) {
    .hero-overlay h1 {
        font-size: 1.7rem;
    }

    .hero-subtext {
        font-size: 0.95rem;
    }

    .card {
        flex: none;
        height: 380px;
        min-height: auto;
    }
}