/* Frontend Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

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

/* Header */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    --header-text-color: #333;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 10px 0;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.site-logo .logo-img {
    max-height: 50px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--header-text-color, #555);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
    opacity: 0.85;
}

.main-nav a:hover {
    opacity: 1;
}

.lang-switch {
    position: relative;
}

.lang-dropdown {
    position: relative;
}

.lang-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--header-text-color, #888);
    background: none;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.85;
}

.lang-dropdown-toggle:hover {
    opacity: 1;
}

.lang-dropdown:hover .lang-dropdown-toggle {
    border-radius: 4px 4px 0 0;
    opacity: 1;
}

.lang-arrow {
    font-size: 0.7rem;
}

.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: -1px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    white-space: nowrap;
    z-index: 1000;
    padding-top: 5px;
}

.lang-dropdown:hover .lang-dropdown-menu {
    display: block;
}

.lang-dropdown-menu a {
    display: block;
    color: #555;
    text-decoration: none;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.lang-dropdown-menu a:hover {
    background: #f5f5f5;
}

.lang-dropdown-menu a.active {
    background: #2c3e50;
    color: #fff;
}

/* Menu toggle button (hidden on desktop) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--header-text-color, #333);
    padding: 4px 8px;
    line-height: 1;
}

/* Header Search */
.search-form-header {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-input-header {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    width: 150px;
    transition: all 0.2s;
}

.search-input-header:focus {
    outline: none;
    border-color: #667eea;
    width: 200px;
}

.search-btn-header {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    color: var(--header-text-color, #888);
    transition: opacity 0.2s;
    opacity: 0.85;
}

.search-btn-header:hover {
    opacity: 1;
}

/* Main */
.site-main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    margin: -40px -20px 40px;
    border-radius: 0 0 20px 20px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Article List */
.article-list, .tag-list, .search-results {
    display: grid;
    gap: 30px;
}

.article-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.article-card h2 {
    margin-bottom: 10px;
}

.article-card h2 a {
    color: #2c3e50;
    text-decoration: none;
}

.article-card h2 a:hover {
    color: #667eea;
}

.article-meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-badge {
    background: #e8f0fe;
    color: #667eea;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-decoration: none;
}

.tag-badge:hover {
    background: #667eea;
    color: #fff;
}

.article-excerpt {
    color: #666;
    margin-bottom: 15px;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

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

/* Article Detail */
.article-detail {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.article-detail h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.article-content {
    margin-top: 30px;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 15px;
}

.translations {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.translations a, .translations .current-lang {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 5px;
    border-radius: 4px;
    text-decoration: none;
}

.translations a {
    background: #e8f0fe;
    color: #667eea;
}

.translations .current-lang {
    background: #667eea;
    color: #fff;
}

/* Search */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-info {
    color: #666;
    margin-bottom: 20px;
}

/* Static Page */
.static-page {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.static-page h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a, .pagination .current {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
}

.pagination a {
    background: #fff;
    color: #667eea;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: #fff;
}

/* 404 */
.not-found {
    text-align: center;
    padding: 80px 0;
}

.not-found h1 {
    font-size: 6rem;
    color: #ddd;
}

.not-found p {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 20px;
}

.not-found a {
    color: #667eea;
    text-decoration: none;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #5a6fd6;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: #aaa;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: nowrap;
        height: auto;
        padding: 12px 0;
        gap: 10px;
    }

    /* Show hamburger menu on mobile */
    .menu-toggle {
        display: block;
        order: 2;
    }

    /* Nav becomes dropdown */
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        padding: 10px 0;
        z-index: 999;
    }

    .main-nav.nav-open {
        display: flex;
    }

    .site-header #mainNav.main-nav a {
        padding: 12px 20px;
        border-bottom: 1px solid #f0f0f0;
        opacity: 1;
        color: #333 !important;
        
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a:hover {
        background: #f5f5f5;
        opacity: 1;
    }

    .site-header {
        position: sticky;
    }

    /* Mobile: hide search input, keep only the icon */
    .search-input-header {
        display: none;
    }

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

    .article-detail {
        padding: 20px;
    }
}
