/* removes default margin padding for ALL ELEMENTS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll; /* prevents content shift when mobile menu opens */
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    position: relative; /* needed for the ::after pseudo-element positioning */
    padding-top: 70px;
    color: #333;
}

body.resizing .deskNav,
body.resizing .dropdown-menu,
body.resizing::after {
    transition: none !important;
}

/* ==== new nav bar  ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; /* always stays on top */
    top: 0;
    left: 0;
    right: 0;
    background-color: #F0F4F8;
    padding: 10px;
    height: 70px;
    z-index: 1001; /* sits on top of the slide-in menu */
    box-shadow: 0 2px 5px rgba(183, 183, 183, 0.646);
}   

header > div > a {
    text-decoration: none;
    display: flex;
    align-items: center;
    color: black;
}

.logo-clear {
    width: clamp(40px, 7vw, 55px);
    height: auto;
}

.logoBox {
    gap: 10px;
}

.logo-text {
    color: rgb(26, 54, 106);
    font-weight: 300;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    white-space: nowrap;
}

header > div > a:visited {
    color: black;
} 

.nav2 ul {
    list-style: none;
}

.deskNav {
    display: flex;
}

.nav2 a {
    text-decoration: none;
}

.nav2btn {
    border: none;
    background-color: transparent;
    font-family: inherit;
    font-size: medium;
    padding: 16px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: black;
    gap: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.nav2btn:hover {
    background-color: #c9d5e5;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.64);
    cursor: pointer;
}

.nav2btn > .caret {
    font-size: 8px;
}

.deskNav:hover .contact-us:not(:hover) {
    box-shadow: none;
}

.contact-us:hover {
    box-shadow: inset 0 0px 3px rgba(0, 0, 0, 0.64);
}

/* ==== dropdown ==== */
.dropdown-container {
    position: relative;
}

.dropdown-container.active .nav2btn {
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.64);
    background-color: rgb(248, 248, 248);
    color: black;
}

.dropdown-container.active .caret {
    color: black;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0px;
    top: 100%;
    background-color: rgb(255, 255, 255);
    list-style: none;
    padding: 0;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.16);
    border-radius: 8px;
    overflow: hidden; /* clip children to rounded corners */
}

.dropdown-container.active .dropdown-menu {
    display: flex;
    flex-direction: column;
    width: 128%;
}

.dropdown-container .caret {
    transform: rotate(-90deg);
    transition: transform 0.4s;
}

.dropdown-container.active .caret {
    transform: rotate(0deg);
    transition: transform 0.4s;
}

.dropdown-menu li a {
    display: block;
    padding: 16px 20px;
    color: black;
    text-decoration: none;
    transition: background-color 0.2s;
    text-align: center;
}

.dropdown-menu .dropdown-child {
    position: relative;
}

/* dropdown seperators! */
.dropdown-menu .dropdown-child:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background-color: #a0a3a9;
}

.dropdown-menu li:hover {
    background-color: #4fc8e3;
    color: white;
}

.dropdown-menu .dropdown-child:hover::after,
.dropdown-menu .dropdown-child:has(+ .dropdown-child:hover)::after {
    background-color: transparent;
}

.dropdown-menu li:hover a {
    color: white;
}

/* ==== burger ==== */
.burger {
    display: none;
    background-color: white;
    border-radius: 8px;
    border: none;
    padding: 14.5px;
    transition: background-color 0.3s;
    width: 60px;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.4);
}

.burger:hover {
    background-color: rgb(224, 224, 224);
    cursor: pointer;
}

.burger:hover .bar {
    background-color: black;
}

.bar {
    width: 25px;
    height: 3px;
    display: block;
    background-color: black;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.2s, width 0.3s, background-color 0.3s;
}

.burger .bar + .bar {
    margin-top: 6px;
}

/* ==== general section ==== */
.content-section, 
.content-section-off-white, 
#hero, 
footer {
    scroll-margin-top: 70px; /* Offset for fixed header */
}

.content-section-off-white {
    padding: 4rem 2rem;
    background-color: #F0F4F8;
}

.content-section {
    background-color: white;
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: rgb(26, 54, 106);
}

.section-title-left {
    text-align: left;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: rgb(26, 54, 106);
}

.subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #ffffff;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.cta-button {
    background-color: #07a0c3;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    /* font-weight: bold; */
    transition: background-color 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.24);
}

.cta-button:hover {
    background-color: #057a96;
}


/* ==== hero section ==== */
#hero {
    background-color: white;
    padding: 5rem 2rem;
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.64)), url("hero-bg.jpg");
    background-size: cover;
    background-position: top;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: rgb(0, 200, 255);
    margin-bottom: 1rem;
    font-weight: normal;
}

/* ==== services ==== */
.services-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 2rem auto 0;
}

.service-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    text-align: center;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.service-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 2.5rem;
    color: #07a0c3;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: rgb(26, 54, 106);
}

.service-card p {
    line-height: 1.6;
    color: #555;
}

/* ==== about ==== */
.two-column-layout {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
}

.text-column {
    flex: 1.2;
    line-height: 1.7;
}

.image-column {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.box-img {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 10px;
    max-width: 100%;
    height: auto;
    display: block; 
}

/* ==== testimonials ==== */
.testimonials-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 2rem auto 0;
}

.testimonial-card {
    background-color: white;
    border-left: 4px solid #07a0c3;
    padding: 1.5rem;
    flex: 1;
    min-width: 280px;
    max-width: 450px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.testimonial-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.testimonial-card .quote {
    font-style: italic;
    color: #444;
    margin-bottom: 1rem;
}

.testimonial-card cite {
    font-weight: bold;
    color: rgb(26, 54, 106);
}

/* ==== cta ==== */
#cta {
    text-align: center;
    position: relative; /* For positioning the rockets */
    overflow: hidden;   /* Hides rockets before/after animation */
}

.cta-rocket {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0;
    animation: fly-up-right 4s ease-in-out infinite;
    bottom: 0px;
    pointer-events: none; /* make rockets not text */
}

.cta-rocket.rocket-1 {
    color: #07a0c3;
    left: 0%;
    animation-delay: 0s;
}

.cta-rocket.rocket-2 {
    color: #1A366A;
    right: 15%;
    animation-delay: 1.5s;
}

@keyframes fly-up-right {
    0%   { opacity: 0; transform: translate(0, 0); }
    20%  { opacity: 0.7; }
    80%  { opacity: 0.7; }
    100% { opacity: 0; transform: translate(15vw, -30vh); }
}


/* ==== footer ==== */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
}

.footer-container i {
    color: #c7d4d7;
}

footer.highlight {
    animation: highlight-animation 1.6s ease-out;
}

.footer-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

@keyframes highlight-animation {
    0% {
        background-color: #2c3e50;
    }
    20% {
        background-color: #067b96;
    }
    100% {
        background-color: #2c3e50;
    }
}

.footer-info {
    display: flex;
    align-items: flex-start;
    position: relative; /* Establishes a positioning context for pseudo-elements */
    gap: 1rem;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem 0; /* add top padding */
}

.footer-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(155, 155, 155, 0.306);
}

.footer-logo {
    height: 40px;
    width: auto;
}

.footer-title {
    font-size: clamp(1.4rem, 4vw, 1.6rem);
    font-weight: lighter;
    color: #fff;
    letter-spacing: 0.5px;
}

.map-link {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.info-box {
    display: flex;
    justify-content: space-between;
    padding-bottom: 2rem;
    background-color: transparent;
    flex-wrap: wrap;
}

.info-left, .info-right {
    width: 50%;
    box-sizing: border-box;
    font-weight: lighter;
}

.info-left ul, .info-right ul {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

/* internal padding for spacing between columns */
.info-left {
    padding-right: 2rem;
}


.info-right {
    padding-left: 2rem;
    display: flex;
    /* box (not content) align right in desktop view */
    flex-direction: column;
    align-items: space-between;
}

.info-left ul, .info-right ul {
    list-style: none;
    line-height: 1.8;
}

.info-box a {
    text-decoration: none;
    color: #60dcff;
    transition: color 0.3s;
}

.info-box a:hover {
    color: #fff;
}

.map-link-box {
    display: flex;
    gap: 32px;
}

.nav-glyph {
    color: #ecf0f1;
}

.info-box > div > ul > li {
    padding: 0.5rem 0;
}

.info-category {
    font-weight: lighter;
    color: #b7d3d4;
    white-space: nowrap;
}

/* footer info's glyph+category */
.info-label {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ==== copyright */
.copyright {
    text-align: center;
    padding: 1.5rem;
    background: #1f2c38;
    font-size: 0.9rem;
}

.copy-unicode {
    color: #829394;
    font-weight: lighter;
}

body.mobile-nav-open {
    overflow: hidden;
}

/* default state for overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999; /* sits behind the header and menu */
    opacity: 0;
    pointer-events: none; /* not clickable when hidden */
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active state for the overlay */
body.mobile-nav-open::after {
    opacity: 1;
    pointer-events: auto; /* make it clickable to close the menu */
}

@media (max-width: 888px) {
    
    .content-section, .content-section-off-white {
        padding: 3rem 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }

    .two-column-layout {
        flex-direction: column;
    }
    
    /* reverse order on mobile for about section */
    #about .two-column-layout {
        flex-direction: column-reverse;
    }

    .section-title-left {
        text-align: center;
    }
    
    .deskNav {
        flex-direction: column;
        gap: 0;
        position: fixed;
        top: 70px; /* start below the header */
        right: 0;
        width: 85vw; /* use viewport width for responsiveness */
        max-width: 320px;
        height: calc(100vh - 70px); /* fill remaining height */
        padding: 0px 16px 0px 16px;
        background-color: #F0F4F8;
        box-shadow: none;
        z-index: 1000; /* Sits below the header */
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .deskNav.mobile-active {
        transform: translateX(0);
    }

    .deskNav > li:not(.mobile-nav-header) {
        border-bottom: 1px solid #bbbfc5;
        margin: 0;
        transition: border-color 0s ease;
    }

    .deskNav > li:hover,
    .deskNav > li.dropdown-container.active {
        border-bottom-color: transparent;
    }

    .deskNav > li:has(+ li:hover),
    .deskNav > li:has(+ li.dropdown-container.active) {
        border-bottom-color: transparent;
    }


    .deskNav > li:last-child {
        border-bottom: none;
    }

    .nav2btn {
        justify-content: flex-start;
        width: 100%;
        padding: 16px;
    }

    .contact-us {
        box-shadow: none;
    }

    .dropdown-container {
        position: static;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dropdown-menu {
        display: block; 
        position: static;
        box-shadow: none;
        width: 100%;
        background-color: #d8dce0;
        padding: 0;
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 8px;
        border-bottom: none;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    margin-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .dropdown-container:hover .caret {
        color: black;
    }

    .dropdown-container.active .caret {
        color: black;
    }

    .dropdown-container.active:hover .caret {
        color: rgb(255, 255, 255);
    }

    .dropdown-container.active .dropdown-menu {
        max-height: 300px;
        opacity: 1;
        margin-top: 16px;
        padding: 0;
        width: 100%;
        margin-bottom: 16px; /* margin-bottom only when active */
    }

    .dropdown-container.active > .nav2btn {
        background-color: rgb(248, 248, 248);
        color: black;
    }

    .dropdown-container.active > .nav2btn:hover {
        background-color: #07a0c3;
        color: white;
    }

    .dropdown-menu li a {
        text-align: left;
        padding: 16px;
    }

    .burger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .burger.active {
        background-color: #07a0c3;
    }
    
    .burger.active .bar {
        background-color: white;
    }
    
    .burger.active:hover .bar {
        background-color: white;
    }

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

    .burger.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        width: 35.36px;
    }

    .burger.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        width: 35.36px;
    }

    .footer-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .info-box > div {
        min-width: unset;
        width: 100%;
    }

    .info-left, .info-right {
        width: 100%;
        padding: 0;
    }

    .deskNav a.nav2btn[href="#services"]:hover,
    .deskNav a.nav2btn[href="#about"]:hover,
    .deskNav a.nav2btn[href="#contact"]:hover {
        box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.64);
    }

    /* info box separator */
    .info-box .footer-info::after {
    content: '';
    position: absolute;
    bottom: 0rem;
    left: 2.28rem;
    right: 0rem;
    height: 1px;
    background-color: rgba(155, 155, 155, 0.169);
    }

    .info-left {
    display: flex;
    flex-direction: column;
    /* box (not content) align left in mobile view */
    align-items: space-between;
    }

    .info-right {
    display: flex;
    flex-direction: column;
    /* box (not content) align left in mobile view */
    align-items: space-between;
    }

    .info-right .footer-info:last-child::after{
    content: '';
    position: absolute;
    bottom: 0;
    height: 0px;
    }

    .map-link-box {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
}

/* stack footer logo and title on small screens */
@media (max-width: 420px) {
    .footer-header {
        flex-direction: column;
    }

    .info-content {
        word-break: break-all;
        /* overflow-wrap: break-word; */ /* this option is too gentle */  
    }

    .footer-info-long {
        flex-direction: column;
    }

    .footer-info-long .info-content {
        margin-left: 2.28rem;
    }

    .footer-info {
    display: flex;
    align-items: flex-start;
    position: relative; /* Establishes a positioning context for pseudo-elements */
    }
}

/* hide logo image on very small screens to prevent the burger menu from being squished */
@media (max-width: 300px) {
    .logo-clear {
        display: none;
    }
    .logoBox {
        padding-left: 6px; /* balance horizontal and vertical spacing for the text */
    }

    .footer-info {
        flex-direction: column;
    }

    .footer-info .info-content {
        margin-left: 2.28rem;
    }

}

/* desktop dropdowns animation  */
@media (min-width: 889px) {
    .dropdown-menu {
        display: flex; 
        flex-direction: column;
        width: 128%;
        opacity: 0;
        transform: translateY(-15px);
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    }

    .dropdown-container.active .dropdown-menu {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
    }
}