/* Basic Reset & Defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', '微軟正黑體', 'Heiti TC', '黑體-繁', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: #0056b3; /* A professional blue */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #003d80;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.8em;
    color: #222;
}

/* Header */
header {
    background-color: #003366; /* Dark blue */
    color: #fff;
    padding: 1em 0;
    border-bottom: 3px solid #f0ad4e; /* Accent color */
}

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

.logo-area .logo-text {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
}
/* .logo-area .logo-img { height: 50px; } */

header nav ul {
    display: flex;
}

header nav ul li a {
    color: #fff;
    padding: 0.5em 1em;
    display: block;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

header nav ul li a:hover,
header nav ul li a.active {
    background-color: #004080;
    border-radius: 4px;
    text-decoration: none;
}

.header-utils .favorite-link {
    color: #f0ad4e;
    padding: 0.5em 1em;
    border: 1px solid #f0ad4e;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.header-utils .favorite-link:hover {
    background-color: #f0ad4e;
    color: #003366;
    text-decoration: none;
}

.mobile-nav-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: 1px solid #fff;
    color: #fff;
    font-size: 1.5em;
    padding: 0.2em 0.5em;
    cursor: pointer;
}


/* Hero Banner */
.hero-banner {
    width: 100%;
    max-height: 350px; /* Adjust as needed */
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #ddd; /* Placeholder if image fails */
}

.hero-banner img {
    width: 100%;
    height: auto;
    object-fit: cover; /* Ensures the image covers the area, might crop */
}

/* News Ticker */
.news-ticker-section {
    background-color: #e9ecef;
    padding: 10px 0;
    margin-bottom: 20px;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}
.news-ticker {
    display: flex;
    align-items: center;
    overflow: hidden;
    font-size: 0.95em;
}
.news-ticker span {
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
    color: #555;
}
.ticker-wrap {
    flex: 1;
    overflow: hidden;
}
.ticker-move {
    display: inline-block; /* Changed from flex to allow single line animation */
    white-space: nowrap;
    animation: ticker 30s linear infinite; /* Adjust duration as needed */
}
.ticker-item {
    display: inline-block; /* Changed for horizontal layout */
    margin-right: 50px; /* Space between items */
}
.ticker-item a {
    color: #d9534f; /* A reddish color for alerts */
}
.ticker-item a:hover {
    color: #c9302c;
}

@keyframes ticker {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); } /* Moves half the width (since content is duplicated) */
}


/* Main Content */
main {
    padding-top: 20px;
    padding-bottom: 40px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.content-block {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.content-block h2 {
    font-size: 1.5em;
    color: #003366;
    border-bottom: 2px solid #f0ad4e;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.content-block h2 a {
    color: #003366;
}
.content-block h2 a:hover {
    color: #0056b3;
}

.more-link {
    font-size: 0.7em;
    font-weight: normal;
    color: #555;
}

/* Latest News Block */
.latest-news article {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dotted #eee;
    display: flex;
    align-items: flex-start;
}
.latest-news article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.latest-news .news-index {
    background-color: #f0ad4e;
    color: #fff;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    font-weight: bold;
    flex-shrink: 0;
}
.latest-news article h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
}
.latest-news article h3 a {
    color: #333;
}
.latest-news article h3 a:hover {
    color: #0056b3;
}
.latest-news article p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}
.latest-news article time {
    font-size: 0.8em;
    color: #888;
    display: block;
}


/* Membership Info Block */
.membership-info h3 {
    font-size: 1.1em;
    color: #444;
    margin-top: 15px;
    margin-bottom: 8px;
}
.membership-info p, .membership-info ul li {
    font-size: 0.95em;
    margin-bottom: 10px;
}
.membership-info ul {
    list-style: disc;
    padding-left: 20px;
}
.membership-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}
.btn {
    background-color: #0056b3;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    text-align: center;
    display: inline-block;
    font-size: 0.95em;
    border: none;
    cursor: pointer;
}
.btn:hover {
    background-color: #003d80;
    text-decoration: none;
    color: #fff;
}


/* Activity Highlights */
.gallery-placeholder {
    text-align: center;
    color: #777;
    padding: 20px;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

/* Footer */
footer {
    background-color: #333;
    color: #ccc;
    padding: 30px 0 15px;
    margin-top: 40px;
    font-size: 0.9em;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #555;
}

.footer-logo p {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
}
/* .footer-logo img { height: 40px; margin-bottom: 10px; } */


.footer-contact p {
    margin-bottom: 5px;
}

.copyright {
    text-align: center;
    font-size: 0.85em;
}
.copyright p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    header nav {
        display: none; /* Hide desktop nav */
        width: 100%;
        order: 3; /* Make it appear below logo and toggle */
        margin-top: 10px;
    }
    header nav.active { /* Class to show mobile nav */
        display: block;
    }
    header nav ul {
        flex-direction: column;
    }
    header nav ul li a {
        padding: 0.8em 0;
        text-align: center;
        border-bottom: 1px solid #004080;
    }
    header nav ul li:last-child a {
        border-bottom: none;
    }
    .mobile-nav-toggle {
        display: block; /* Show hamburger icon */
        order: 2; /* Position it after the logo if logo is wide, or adjust as needed */
    }
    .logo-area {
        flex-grow: 1; /* Allow logo to take available space */
    }

    .news-ticker {
        font-size: 0.85em;
    }
    @keyframes ticker { /* Adjust for potentially less space */
      0% { transform: translateX(5%); } /* Start slightly off-screen */
      100% { transform: translateX(-50%); }
    }

    .content-grid {
        grid-template-columns: 1fr; /* Stack blocks on smaller screens */
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-logo, .footer-contact {
        width: 100%;
    }
}