:root {
    /* Dark Theme (Default) */
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --heading-color: #fff;
    --accent-color: #e0c097;
    --card-bg: #1e1e1e;
    --sidebar-bg: #1e1e1e;
    --border-color: #333;
    --meta-color: #888;
    --lightbox-bg: rgba(0, 0, 0, 0.9);
    --code-bg: #1a1a1a;
}

body.light-theme {
    /* Light Theme (Shining Style) */
    --bg-color: #f4f4f4; /* Light Grey Background */
    --text-color: #333333;
    --heading-color: #111111;
    --accent-color: #D8CDCB; /* Beige/Grey Accent */
    --card-bg: #ffffff; /* White containers */
    --sidebar-bg: #ffffff;
    --border-color: #e0e0e0;
    --meta-color: #666666;
    --lightbox-bg: rgba(0, 0, 0, 0.9);
    --code-bg: #eaeaea;
}

/* Specific overrides for Light Theme (Shining Style) */
body.light-theme header {
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.light-theme .blog-card {
    border: 1px solid var(--border-color);
    box-shadow: none;
}

body.light-theme .main-nav a {
    color: #626a6c;
}

body.light-theme .main-nav a:hover,
body.light-theme .main-nav a.active {
    color: #0f0e17;
    border-bottom-color: #D8CDCB;
}

/* Light Theme Homepage Header Overrides */
body.light-theme .hero-header {
    background: rgba(255, 255, 255, 0.85); /* Light background for menu */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

body.light-theme .hero-header.subpage-header {
    position: sticky;
}

body.light-theme .logo,
body.light-theme .logo a {
    color: var(--heading-color); /* Dark Logo */
}

body.light-theme .hero-header .main-nav a {
    color: var(--text-color);
}

body.light-theme .hero-header .main-nav a:hover,
body.light-theme .hero-header .main-nav a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

body.light-theme .hero {
    background-image: url('Photo/Homepage/_DSF9376.JPG');
}

/* Light Theme About Section Overrides - Removed as part of redesign */
/* body.light-theme .about-text { ... } */
/* body.light-theme .about-section-redesign::before { ... } */

/* Specific overrides for Shining Theme (Deprecated/Merged into Light Theme) */
body.theme-shining {
    /* Shining Theme (Data & Analytics) */
    --bg-color: #ffffff;
    --text-color: #0f0e17;
    --heading-color: #0f0e17;
    --accent-color: #D8CDCB; /* Beige/Grey Accent */
    --card-bg: #ffffff; /* Clean white cards */
    --sidebar-bg: #f9f9f9;
    --border-color: #D8CDCB;
    --meta-color: #626a6c;
    --lightbox-bg: rgba(255, 255, 255, 0.98);
    --code-bg: #f4f4f4;
}

/* Specific overrides for Shining Theme */
body.theme-shining header {
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.5); /* 50% Transparent Background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky; /* Optional: make it sticky if desired, but user didn't ask. Keeping relative/static default unless needed. */
    top: 0;
    z-index: 100;
}

body.theme-shining .blog-card {
    border: 1px solid var(--border-color);
    box-shadow: none; /* Flat design */
}

body.theme-shining .main-nav a {
    color: #626a6c;
}

body.theme-shining .main-nav a:hover,
body.theme-shining .main-nav a.active {
    color: #0f0e17;
    border-bottom-color: #D8CDCB;
}

body {
    font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header > .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

header h1 {
    font-weight: 600;
    font-size: 1.5rem; /* Reduced size for header bar */
    margin-bottom: 0; /* Remove bottom margin */
    color: var(--heading-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

header p {
    color: #999;
    font-size: 1rem;
    width: 100%; /* Force to new line */
    text-align: center;
    order: 3; /* Move to bottom */
    margin-top: 1rem;
    line-height: 1.8;
    font-weight: 300;
    display: none; /* Hide page title in header to align Logo and Menu cleanly */
}

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

/* Masonry Layout using CSS Columns */
.gallery {
    column-count: 4;
    column-gap: 20px;
    padding-bottom: 4rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    background-color: var(--card-bg);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.gallery-item:hover img {
    transform: scale(1.03);
    filter: brightness(1.1);
}

/* Gallery Grid - Instagram Style Masonry */
.gallery-grid {
    column-count: 3;
    column-gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

@media (max-width: 1400px) {
    .gallery { column-count: 3; }
}
@media (max-width: 900px) {
    .gallery { column-count: 2; }
    .gallery-grid {
        column-count: 2;
    }
}
@media (max-width: 600px) {
    .gallery { column-count: 1; }
    .gallery-grid {
        column-count: 1;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--lightbox-bg);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95vh;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-radius: 4px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 2001;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    backdrop-filter: blur(5px);
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        padding: 10px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}

/* Navigation */
.main-nav {
    margin-top: 0; /* Remove top margin */
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Reduced gap */
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400; /* Lighter weight */
    font-size: 1rem;
    padding-bottom: 8px; /* More space for underline */
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.8;
    text-transform: uppercase; /* Uppercase English */
    letter-spacing: 2px; /* Spacing */
}

.main-nav a:hover,
.main-nav a.active {
    opacity: 1;
    border-bottom-color: var(--accent-color);
    color: var(--heading-color); /* Use heading color for active */
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 10px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--accent-color);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* Add Chevron Down Icon to Dropdown Triggers */
.dropdown > a::after {
    content: '\f107'; /* FontAwesome angle-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 0.8em;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.dropdown:hover > a::after {
    transform: rotate(180deg);
    opacity: 1;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 160px; /* Slightly wider for left alignment */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 1000;
    border-radius: 8px;
    padding: 5px 0;
    top: 100%;
    left: 0; /* Align to left */
    transform: none; /* Remove center transform */
    border: 1px solid var(--border-color);
    margin-top: 10px;
}

/* Arrow for dropdown */
.dropdown-content::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 20px; /* Align arrow to left */
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(30, 30, 30, 0.8) transparent;
}

/* Bridge to prevent menu closing */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.dropdown:hover > .dropdown-content {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-content a {
    color: var(--text-color);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    text-align: left; /* Align text to left */
    border-bottom: none;
    opacity: 0.8;
    font-size: 1rem;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
    opacity: 1;
    border-bottom: none;
}

/* Active state for dropdown parent if child is active */
.dropdown:has(.active) > .dropbtn {
    color: #fff;
    border-bottom-color: var(--accent-color);
    opacity: 1;
}

/* Light Theme Adjustments for Dropdown */
body.light-theme .dropdown-content,
body.theme-shining .dropdown-content {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.light-theme .dropdown-content::after,
body.theme-shining .dropdown-content::after {
    border-color: transparent transparent rgba(255, 255, 255, 0.8) transparent;
}

body.light-theme .dropdown-content a:hover,
body.theme-shining .dropdown-content a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Nested Dropdown Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-content {
    top: 0;
    left: 100%;
    margin-top: -5px;
    margin-left: 10px; /* Small gap */
    display: none;
}

/* Arrow for nested dropdown items */
.dropdown-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-submenu > a::after {
    content: '\f105'; /* FontAwesome angle-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 10px;
    font-size: 0.8em;
    opacity: 0.5;
}

.dropdown-submenu:hover > .dropdown-content {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

/* Bridge for nested dropdown to prevent closing when crossing the gap */
.dropdown-submenu > .dropdown-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 100%; /* Position to the left of the content */
    width: 15px; /* Covers the 10px margin plus a bit more */
    height: 100%;
    background: transparent;
}

/* Adjust arrow for nested dropdown content */
.dropdown-submenu > .dropdown-content::after {
    border-color: transparent rgba(30, 0.8) transparent transparent;
    right: 100%;
    left: auto;
    top: 15px;
    bottom: auto;
    border-width: 5px;
}

/* Light theme adjustment for nested arrow */
body.light-theme .dropdown-submenu > .dropdown-content::after,
body.theme-shining .dropdown-submenu > .dropdown-content::after {
    border-color: transparent rgba(255, 255, 255, 0.8) transparent transparent;
}

/* Donate Page */
.donate-content {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.donate-card {
    background-color: #1e1e1e;
    padding: 3rem;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.donate-card h2 {
    margin-bottom: 1.5rem;
    color: #fff;
}

.donate-card p {
    color: #aaa;
    margin-bottom: 2rem;
}

.donation-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.donate-btn {
    background: transparent;
    border: 2px solid #333;
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.donate-btn:hover {
    border-color: var(--accent-color);
    background: rgba(187, 134, 252, 0.1);
}

.donate-btn.selected {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
}

.custom-amount input {
    width: 100%;
    padding: 1rem;
    background: #2d2d2d;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.custom-amount input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(45deg, var(--accent-color), #985eff);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(187, 134, 252, 0.3);
}

.secure-note {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Album Navigation */
.album-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.album-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.album-btn:hover {
    border-color: #666;
    color: #fff;
}

.album-btn.active {
    background-color: #fff;
    border-color: #fff;
    color: #000;
}

/* --- New Homepage Design --- */

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    background-image: url('Photo/Homepage/IMG_1365.JPG'); /* Replace with your preferred hero image */
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    text-align: left;
    margin-bottom: 0; /* Reduced from 4rem */
    padding-bottom: 2rem; /* Reduced from 5rem */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
    z-index: 1;
}

.hero-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    padding: 0.5rem 0; /* Reduced padding for consistency */
    background: rgba(0, 0, 0, 0.5); /* 50% Transparent Background for Hero Header */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

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

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Override existing nav styles for the hero header if needed */
.hero-header .main-nav {
    margin-top: 0;
}

.hero-header .main-nav a {
    color: rgba(255, 255, 255, 0.8);
}

.hero-header .main-nav a:hover,
.hero-header .main-nav a.active {
    color: #fff;
    border-bottom-color: #fff;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    padding: 0;
    color: #fff;
}

.hero-content .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    margin: 0 auto;
}

.hero-quote {
    font-size: 1.9rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    font-family: 'Inter', serif; /* Or a serif font if you prefer */
    max-width: 1000px;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.hero-subquote {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    line-height: 1.8;
    max-width: 800px;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    width: auto;
}

.hero-description {
    font-size: 1rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    line-height: 1.6;
    max-width: 800px;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    width: auto;
}

.hero-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-primary {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
}

.btn-primary:hover {
    background-color: #fff;
    color: #000;
}

.btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* About Section Redesign - Modern Clean Style */
.about-section-redesign {
    padding: 2rem 0; /* Reduced from 3rem 0 */
    background-color: var(--bg-color);
    position: relative;
}

/* Removed decorative background text for cleaner look */
.about-section-redesign::before {
    display: none;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.about-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

/* Removed offset border for cleaner look */
.about-image::after {
    display: none;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: all 0.6s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.about-image:hover img {
    transform: scale(1.02);
}

.about-text {
    /* Removed background box for cleaner look */
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    margin-left: 0;
    box-shadow: none;
    border-top: none;
}

.about-text h2 {
    font-family: 'Inter', sans-serif;
    font-size: 2rem; /* Adjusted size */
    margin-bottom: 2rem;
    font-weight: 400; /* Match menu weight */
    color: var(--heading-color);
    line-height: 1.2;
    text-transform: uppercase; /* Match menu style */
    letter-spacing: 2px; /* Match menu spacing */
}

.about-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
}

.about-list li {
    margin-bottom: 1.2rem;
    position: relative;
    padding-left: 25px;
    color: var(--text-color);
    font-weight: 400; /* Match menu weight */
    letter-spacing: 1px;
    font-size: 1rem; /* Match menu size */
}

.about-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.about-description p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 400; /* Match menu weight */
    letter-spacing: 0.5px;
    font-size: 1rem; /* Match menu size */
    line-height: 1.8;
}

.social-links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    padding-bottom: 4px;
}

.social-links a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.social-links i {
    margin-right: 8px;
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-text {
        padding: 0 1rem;
    }
}

/* Latest Posts Section */
.latest-posts-section {
    padding: 2rem 0; /* Reduced from 4rem 0 */
    background-color: var(--bg-color);
}

.gallery-section {
    padding: 2rem 0;
    background-color: var(--bg-color);
}

.section-title {
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 2rem; /* Adjusted to match sans-serif look */
    margin-bottom: 2rem;
    text-align: center;
    color: var(--heading-color);
    font-weight: 400; /* Match menu weight */
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Reuse existing blog-card styles but ensure they work in the grid */
.blog-card-content {
    padding: 1.5rem;
}

.blog-card-title {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.blog-card-title a {
    color: var(--heading-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: var(--accent-color);
}

.blog-card-meta {
    font-size: 0.85rem;
    color: var(--meta-color);
    margin-bottom: 1rem;
    display: flex;
    gap: 10px;
}

.blog-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.read-more {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.read-more:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .hero-quote {
        font-size: 1.8rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .about-text {
        margin-left: 0;
        margin-top: -50px;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        padding: 40px;
    }

    .about-image::after {
        top: 15px;
        left: 15px;
        width: 95%;
        height: 95%;
    }
    
    .header-container {
        flex-direction: row; /* Changed from column to row */
        justify-content: space-between; /* Space out logo and hamburger */
        align-items: center;
        gap: 0;
    }

    .logo-wrapper {
        align-self: center; /* Center vertically */
    }

    .main-nav {
        display: none; /* Hide desktop nav */
    }

    .mobile-menu-toggle {
        display: block;
    }
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--heading-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-container {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background: var(--bg-color);
    z-index: 2001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.mobile-menu-container.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px dotted #ccc;
}

.mobile-menu-logo {
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--heading-color);
    border: 1px solid var(--heading-color);
    padding: 10px 15px;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    flex: 1;
    overflow-y: auto;
}

.mobile-nav a, .mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
}

.mobile-nav-separator {
    border-bottom: 1px dotted #ddd;
    margin: 0;
}

.mobile-dropdown-content {
    display: none;
    padding-left: 15px;
    background: rgba(0,0,0,0.02);
    margin-bottom: 10px;
}

.mobile-dropdown.active .mobile-dropdown-content {
    display: block;
}

.mobile-dropdown-content a {
    font-size: 0.9rem;
    padding: 8px 0;
    color: var(--text-color);
    opacity: 0.8;
}

.mobile-menu-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px dotted #ccc;
}

.mobile-menu-footer a {
    color: var(--text-color);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.mobile-menu-footer a:hover {
    color: var(--accent-color);
}

/* Footer */
footer {
    background-color: #0a0a0a;
    padding: 2rem 0;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    border-top: 1px solid #1a1a1a;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ensure mobile menu toggle is visible on mobile */
@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* Blog Listing */
.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.blog-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.blog-card-image {
    height: 250px;
    overflow: hidden;
    background-color: #2a2a2a;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1.2rem;
    background-color: #222;
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-date {
    font-size: 0.85rem;
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.5rem;
}

.blog-card-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-card-content h2 a {
    color: var(--heading-color);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card-content h2 a:hover {
    color: var(--accent-color);
}

.blog-card-content p {
    color: var(--meta-color);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--heading-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.read-more:hover {
    color: var(--accent-color);
}

/* Blog Post Single */
.blog-post {
    width: 100%;
    margin: 0 auto;
    padding: 2rem 0;
}

.post-header {
    text-align: center;
    margin-bottom: 3rem;
}

.post-date {
    color: var(--accent-color);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1rem;
}

.post-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    color: #888;
    font-size: 0.9rem;
}

.post-content .post-hero-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content .lead {
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--heading-color);
    margin-bottom: 2rem;
}

.post-content h2 {
    color: var(--heading-color);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.post-content img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 1.5rem auto;
}

.post-content figure {
    margin: 2rem 0;
}

.post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.post-gallery figure {
    margin: 0;
}

.post-gallery img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.post-gallery figcaption {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    font-style: italic;
}

blockquote {
    border-left: 4px solid var(--accent-color);
    margin: 2rem 0;
    padding: 1rem 2rem;
    background: var(--card-bg);
    font-style: italic;
    color: var(--heading-color);
    font-size: 1.2rem;
}

.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--meta-color);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--heading-color);
}

/* Code Blocks for Tech Blog */
pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Tech Blog Specifics */
body.light-theme .blog-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

body.light-theme .blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

body.light-theme .blog-sidebar {
    border: 1px solid var(--border-color);
}

body.light-theme header h1 {
    color: #111;
}

body.light-theme .main-nav a {
    color: #555;
}

body.light-theme .main-nav a:hover,
body.light-theme .main-nav a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.blog-container {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.blog-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    background-color: var(--sidebar-bg);
    padding: 30px;
    border-radius: 12px;
}

.blog-sidebar h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--accent-color);
}

.blog-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-sidebar li {
    margin-bottom: 10px;
}

.blog-sidebar a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
}

.blog-sidebar a:hover,
.blog-sidebar a.active {
    color: var(--accent-color);
    padding-left: 5px;
}

.blog-post {
    flex-grow: 1;
    /* Ensure it doesn't overflow */
    min-width: 0; 
}

@media (max-width: 900px) {
    .blog-container {
        flex-direction: column-reverse; /* Content first on mobile? Or sidebar first? Usually content first, but navigation is requested. Let's keep sidebar on top or bottom. Maybe top for nav. */
        flex-direction: column;
    }
    
    .blog-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 2rem;
        box-sizing: border-box;
    }
}

/* Subpage Header Variant */
.hero-header.subpage-header {
    position: relative;
    background: var(--bg-color); /* Match page background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo a {
    text-decoration: none;
    color: inherit;
}
