﻿/* CSS Variables for consistent theming */
:root {
    --primary: #800000;
    --primary-light: #BA3B3B;
    --primary-dark: #5A0000;
    --secondary: #0B2161;
    --secondary-light: #08298A;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f7fa;
}

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

/* Header styles */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 2rem;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-tagline {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Main menu styles */
.main-menu {
    display: flex;
    align-items: center;
}

.menu-list {
    display: flex;
    list-style: none;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--radius);
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-link i {
    font-size: 0.9rem;
}

.menu-link span {
white-space: nowrap;
}        

/* Dropdown styles */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.menu-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

.dropdown-item:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

.dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary);
}

.dropdown-item i {
    margin-right: 8px;
    color: var(--primary);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}
    
    
.headLine {
text-align: center;
padding: 1rem 0.5rem;
background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
color: white;
border-radius: var(--radius);
box-shadow: var(--shadow);
margin: 1rem auto;
max-width: 900px;
}

.headLine h1 {
font-size: 2.2rem;
margin-bottom: 0.75rem;
font-weight: 700;
}

.headLine p {
font-size: 1.1rem;
opacity: 0.9;
font-style: italic;
}


/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1rem 0 1.5rem;
    margin-top: 1rem;
}

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

        .footer-column h3 {
            margin-bottom: 1.5rem;
            position: relative;
            padding-bottom: 10px;
        }

        .footer-column h3::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 50px;
            height: 2px;
            background: var(--primary-light);
        }

        .footer-links {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 10px;
        }

        .footer-links a {
            color: var(--light-gray);
            text-decoration: none;
            transition: var(--transition);
        }

        .footer-links a:hover {
            color: white;
            padding-left: 5px;
        }

        .copyright {
            text-align: center;
            padding-top: 0.5rem;
            font-size: 0.9rem;
            color: var(--light-gray);
        }

        /* Mobile styles */
        @media (max-width: 992px) {
            .menu-toggle {
                display: block;
            }

            .menu-list {
                position: fixed;
                top: 70px;
                left: 0;
                width: 100%;
                background: var(--primary);
                flex-direction: column;
                align-items: center;
                padding: 1rem 0;
                box-shadow: var(--shadow);
                transform: translateY(-100%);
                opacity: 0;
                visibility: hidden;
                transition: var(--transition);
                z-index: 99;
            }

            .menu-list.active {
                transform: translateY(0);
                opacity: 1;
                visibility: visible;
            }

            .menu-item {
                width: 100%;
                text-align: center;
            }

            .menu-link {
                justify-content: center;
                padding: 15px 20px;
            }

            .dropdown {
                position: static;
                width: 100%;
                opacity: 1;
                visibility: visible;
                transform: none;
                display: none;
                box-shadow: none;
                border-radius: 0;
                background: var(--primary-dark);
            }

            .dropdown.active {
                display: block;
            }

            .dropdown-item {
                color: white;
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            }

            .dropdown-item:hover {
                background: rgba(255, 255, 255, 0.1);
            }

            .dropdown-item i {
                color: white;
            }

            .hero h1 {
                font-size: 2rem;
            }

            .hero p {
                font-size: 1rem;
            }
        }

        /* Animation for menu items */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .menu-list.active .menu-item {
            animation: fadeIn 0.3s ease forwards;
        }

        .menu-list.active .menu-item:nth-child(2) {
            animation-delay: 0.1s;
        }

        .menu-list.active .menu-item:nth-child(3) {
            animation-delay: 0.2s;
        }

        .menu-list.active .menu-item:nth-child(4) {
            animation-delay: 0.3s;
        }

        /* Search bar in menu */
        .search-box {
            position: relative;
            margin-left: 20px;
        }

        .search-input {
            padding: 8px 15px 8px 35px;
            border: none;
            border-radius: 50px;
            background: rgba(255, 255, 255, 0.2);
            color: white;
            width: 200px;
            transition: var(--transition);
        }

        .search-input::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        .search-input:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.3);
            width: 250px;
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: rgba(255, 255, 255, 0.7);
        }

        @media (max-width: 768px) {
            .search-box {
                margin: 15px 0 0;
                width: 100%;
            }

            .search-input {
                width: 100%;
            }

            .search-input:focus {
                width: 100%;
            }
        }
/* ==========================================================
   Logo sizing - keeps long (bilingual) logo text and tagline
   from squeezing into a narrow column next to the menu
   ========================================================== */
.header-content { gap: 1rem; }

.logo { flex-shrink: 0; }
.logo-icon { flex-shrink: 0; }

.logo-text {
    white-space: nowrap;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.78rem;
    line-height: 1.35;
    max-width: 22em;
    /* at most two lines, then an ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Desktop: bilingual labels stack (中文 over English); single words are unaffected */
@media (min-width: 993px) {
    .menu-link { padding: 8px 10px; gap: 6px; }
    .menu-link span {
        display: inline-block;
        width: min-content;      /* break only at spaces... */
        word-break: keep-all;    /* ...and never inside a Chinese word */
        white-space: normal;     /* overrides the nowrap set above */
        line-height: 1.25;
        text-align: center;
    }
}

/* Dropdowns near the right edge open leftwards (avoids a horizontal scrollbar) */
@media (min-width: 993px) {
    .menu-list > .menu-item:nth-last-child(-n+3) .dropdown { left: auto; right: 0; }
}

/* Medium desktop: smaller logo and menu text */
@media (min-width: 993px) and (max-width: 1280px) {
    .logo-text { font-size: 1.3rem; }
    .logo-icon { font-size: 1.75rem; }
    .menu-link { padding: 8px 8px; font-size: 0.92rem; }
}

/* Narrow desktop: drop menu icons and chevrons (dropdowns still open on hover) */
@media (min-width: 993px) and (max-width: 1150px) {
    header .container { padding: 0 12px; }
    .logo-text { font-size: 1.15rem; }
    .logo-icon { font-size: 1.5rem; }
    .logo-tagline { font-size: 0.72rem; }
    .menu-link > i { display: none; }
    .menu-link { padding: 8px 7px; }
}

/* Tablet & phone: logo shares the bar with the menu button only */
@media (max-width: 992px) {
    .logo { flex-shrink: 1; min-width: 0; }
    .logo-tagline { max-width: none; }
}

@media (max-width: 600px) {
    .logo { gap: 8px; }
    .logo-icon { font-size: 1.6rem; }
    .logo-text { font-size: 1.1rem; white-space: normal; }
    .logo-tagline { font-size: 0.7rem; -webkit-line-clamp: 1; }
}


/* Language Selector */
.lang-selector {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.lang-selector:focus {
  outline: 2px solid white;
}


/* Force readable dropdown list (Windows / Chrome / Edge) */
.lang-selector option {
  color: black;
  background-color: white;
}

/* ==========================================================
   3D menu - raised tiles with clear separation
   ========================================================== */

/* Desktop: each top-level link is its own raised tile */
@media (min-width: 993px) {
    .menu-list { gap: 6px; align-items: stretch; }

    .menu-link {
        height: 100%;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-bottom-color: rgba(0, 0, 0, 0.28);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.28),   /* top highlight */
            0 2px 0 rgba(0, 0, 0, 0.22),                /* solid lower edge */
            0 4px 8px rgba(0, 0, 0, 0.18);              /* soft drop shadow */
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    .menu-link:hover,
    .menu-item:hover > .menu-link,
    .menu-link:focus-visible {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.10) 100%);
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.35),
            0 4px 0 rgba(0, 0, 0, 0.22),
            0 8px 14px rgba(0, 0, 0, 0.22);
    }

    .menu-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

    /* pressed */
    .menu-link:active {
        transform: translateY(1px);
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
        box-shadow:
            inset 0 2px 4px rgba(0, 0, 0, 0.3),
            0 1px 0 rgba(0, 0, 0, 0.2);
    }

    /* Chevron turns when the dropdown is open */
    .menu-link .fa-chevron-down { font-size: 0.7rem; opacity: 0.85; transition: transform 0.2s ease; }
    .menu-item:hover .fa-chevron-down { transform: rotate(180deg); }

    /* Dropdown: raised card with an accent edge and a pointer */
    .dropdown {
        top: calc(100% + 10px);
        border-top: 3px solid var(--secondary);
        box-shadow:
            0 2px 0 rgba(0, 0, 0, 0.06),
            0 12px 28px rgba(0, 0, 0, 0.25);
    }
    /* invisible bridge so the menu stays open while the pointer crosses the gap */
    .dropdown::before {
        content: '';
        position: absolute;
        left: 0; right: 0; top: -13px;
        height: 13px;
    }
    /* small pointer arrow */
    .dropdown::after {
        content: '';
        position: absolute;
        top: -9px; left: 22px;
        border: 6px solid transparent;
        border-bottom-color: var(--secondary);
    }
    .menu-list > .menu-item:nth-last-child(-n+3) .dropdown::after { left: auto; right: 22px; }

    .dropdown-item:first-child { border-radius: 0; }
    .dropdown-item {
        border-bottom: 1px solid var(--light-gray);
        box-shadow: inset 0 -1px 0 #fff;   /* etched divider */
        transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
    }
    .dropdown-item:hover { padding-left: 26px; background: #f6eaea; }

    /* Language selector matches the tiles */
    .lang-selector {
        height: 100%;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-bottom-color: rgba(0, 0, 0, 0.28);
        border-radius: var(--radius);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 0 rgba(0, 0, 0, 0.22), 0 4px 8px rgba(0, 0, 0, 0.18);
    }
}

/* Header gets a bevelled lower edge so it separates from the page */
header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile/tablet: separated, raised rows */
@media (max-width: 992px) {
    .menu-list { padding: 0.75rem 12px; gap: 8px; }

    .menu-item { border-radius: var(--radius); }

    .menu-link {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-bottom-color: rgba(0, 0, 0, 0.3);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 0 rgba(0, 0, 0, 0.25);
    }
    .menu-link:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3); }

    .dropdown {
        margin-top: 4px;
        border-radius: var(--radius);
        box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
    }
    .dropdown-item:last-child { border-bottom: none; }

    /* Hover/tap: white text on a clearly lighter row, with a white marker bar
       (the desktop rule would otherwise turn the text maroon on maroon) */
    .dropdown-item:hover,
    .dropdown-item:focus-visible,
    .dropdown-item:active {
        color: #fff;
        background: rgba(255, 255, 255, 0.22);
        box-shadow: inset 4px 0 0 #fff;
    }
    .dropdown-item:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
    .menu-link:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.10) 100%); }

    .menu-toggle {
        padding: 4px 10px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: var(--radius);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.05) 100%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 0 rgba(0, 0, 0, 0.25);
    }
    .menu-toggle:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
    .menu-link, .dropdown-item, .menu-link .fa-chevron-down { transition: none; }
    .menu-link:hover, .menu-item:hover > .menu-link { transform: none; }
}
