/* ============================================
   中華教育 - 港風媒體風格官網
   CHUNGHWA EDUCATION - Hong Kong Media Style
   ============================================ */

/* 基礎重置與變量 */
:root {
    --nav-blue: #1a3a5f;           /* 深藍色導航 */
    --nav-blue-light: #2a4a6f;     /* 淺藍色次導航 */
    --primary-red: #C8102E;        /* 主紅色 */
    --text-dark: #1a1a1a;
    --text-light: #666;
    --text-grey: #555;
    --bg-white: #ffffff;
    --bg-light: #f5f5f5;
    --bg-grey: #e8e8e8;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
}

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

/* ============================================
   頂部欄 Top Bar
   ============================================ */
.top-bar {
    background: var(--nav-blue);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-right a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    transition: var(--transition);
}

.top-bar-right a:hover {
    opacity: 0.8;
}

/* ============================================
   主導航 Primary Navigation
   ============================================ */
.primary-nav {
    background: var(--nav-blue);
    padding: 0;
}

.primary-nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 30px;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.nav-logo img {
    height: 60px;
    width: auto;
    display: block;
}

.nav-logo-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-red);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(200, 16, 46, 0.3);
}

.nav-logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap;
}

.primary-nav-list {
    display: flex;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.primary-nav-list li {
    position: relative;
}

.primary-nav-list a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.primary-nav-list a:hover,
.primary-nav-list a.active {
    background: rgba(255,255,255,0.1);
    border-bottom-color: var(--primary-red);
}

.primary-nav-list .search-icon {
    margin-left: auto;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 18px;
}

.primary-nav-list .search-icon:hover {
    background: rgba(255,255,255,0.1);
}

/* ============================================
   次導航 Secondary Navigation
   ============================================ */
.secondary-nav {
    background: var(--nav-blue-light);
    padding: 10px 0;
}

.secondary-nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 25px;
}

.secondary-nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.secondary-nav a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============================================
   Logo區域 Logo Section
   ============================================ */
.logo-section {
    background: white;
    padding: 30px 0;
    border-bottom: 2px solid var(--border-color);
}

.logo-section-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: center;
}

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

.logo-seal {
    width: 80px;
    height: 80px;
    background: var(--primary-red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(200, 16, 46, 0.3);
}

.logo-text-area h1 {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.logo-text-area .subtitle {
    font-size: 14px;
    color: var(--text-light);
    letter-spacing: 1px;
}

.logo-info {
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-grey);
    line-height: 1.8;
}

.logo-info p {
    margin: 3px 0;
}

.sidebar-box {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.sidebar-box-header {
    background: var(--nav-blue);
    color: white;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-box-content {
    padding: 20px;
    font-size: 13px;
    color: var(--text-grey);
    line-height: 1.8;
}

.sidebar-box-content ul {
    list-style: none;
    margin: 15px 0;
}

.sidebar-box-content ul li {
    padding: 5px 0;
    border-bottom: 1px dotted var(--border-color);
}

.qr-codes {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
}

.qr-code-item {
    text-align: center;
}

.qr-code-placeholder {
    width: 80px;
    height: 80px;
    background: var(--bg-grey);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    font-size: 24px;
    color: var(--text-light);
}

.qr-code-label {
    font-size: 11px;
    color: var(--text-grey);
}

/* ============================================
   主內容區 Main Content
   ============================================ */
.main-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.content-area {
    background: white;
}

.section-header {
    border-bottom: 3px solid var(--nav-blue);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 24px;
    color: var(--nav-blue);
    font-weight: 700;
    display: inline-block;
    padding-right: 20px;
}

/* ============================================
   新聞文章 News Articles
   ============================================ */
.news-article {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.news-article:last-child {
    border-bottom: none;
}

.news-article-header {
    margin-bottom: 15px;
}

.news-article h3 {
    font-size: 22px;
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

.news-article h3 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.news-article h3 a:hover {
    color: var(--primary-red);
}

.news-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.news-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-article-image {
    width: 100%;
    height: 300px;
    background: var(--bg-grey);
    margin: 15px 0;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 48px;
}

.news-article-content {
    font-size: 15px;
    color: var(--text-grey);
    line-height: 1.8;
    margin-top: 15px;
}

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

/* ============================================
   側邊欄 Sidebar
   ============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.sidebar-widget-header {
    background: var(--bg-light);
    padding: 12px 15px;
    border-bottom: 2px solid var(--primary-red);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.sidebar-widget-content {
    padding: 15px;
}

/* ============================================
   信息卡片 Info Cards
   ============================================ */
.info-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.info-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    padding: 25px 20px;
    text-align: center;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--primary-red);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.info-card-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin: 0 auto 15px;
}

.info-card h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.info-card p {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.info-card .btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--nav-blue);
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    transition: var(--transition);
}

.info-card .btn:hover {
    background: var(--primary-red);
}

/* ============================================
   按鈕 Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-red);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.btn:hover {
    background: #A00D25;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
}

.btn-outline:hover {
    background: var(--primary-red);
    color: white;
}

/* ============================================
   頁面標題 Page Header
   ============================================ */
.page-header {
    background: var(--nav-blue);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 16px;
    letter-spacing: 2px;
    opacity: 0.9;
}

/* ============================================
   關於我們頁面 About Page
   ============================================ */
.about-section {
    padding: 40px 0;
    background: white;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-content h2 {
    font-size: 32px;
    color: var(--nav-blue);
    margin-bottom: 25px;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-red);
    padding-bottom: 15px;
}

.about-content h3 {
    font-size: 24px;
    color: var(--primary-red);
    margin: 30px 0 15px;
    font-weight: 600;
}

.about-content p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-grey);
}

.mission-list {
    list-style: none;
    margin: 20px 0;
}

.mission-list li {
    padding: 12px 0;
    font-size: 16px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dotted var(--border-color);
}

.mission-list li i {
    color: var(--primary-red);
    font-size: 18px;
}

/* ============================================
   聯繫我們頁面 Contact Page
   ============================================ */
.contact-section {
    padding: 40px 0;
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.contact-info h2,
.contact-form-wrapper h2 {
    font-size: 28px;
    color: var(--nav-blue);
    margin-bottom: 25px;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-red);
    padding-bottom: 15px;
}

.contact-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 5px;
    border-left: 4px solid var(--primary-red);
}

.contact-icon {
    width: 45px;
    height: 45px;
    background: var(--nav-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-details h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.contact-details p {
    color: var(--text-grey);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.contact-form {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group label span {
    color: var(--primary-red);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.map-section {
    margin-top: 40px;
}

.map-section h2 {
    font-size: 28px;
    color: var(--nav-blue);
    margin-bottom: 25px;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-red);
    padding-bottom: 15px;
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-grey);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.map-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--primary-red);
}

/* ============================================
   電子報刊頁面 Journal Page
   ============================================ */
.journal-section {
    padding: 40px 0;
    background: white;
}

.journal-info {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.journal-barcode {
    text-align: center;
    padding: 25px;
    background: white;
    border-radius: 5px;
    border: 2px solid var(--border-color);
}

.barcode-icon {
    font-size: 48px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.journal-barcode p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 2px;
}

.journal-description h2 {
    font-size: 28px;
    color: var(--nav-blue);
    margin-bottom: 12px;
    font-weight: 700;
}

.journal-description p {
    font-size: 15px;
    color: var(--text-grey);
    line-height: 1.8;
}

.journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.journal-card {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.journal-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.journal-cover {
    width: 100%;
    height: 250px;
    background: var(--bg-grey);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-placeholder {
    font-size: 64px;
    color: var(--text-light);
}

.journal-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-red);
    color: white;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.journal-content {
    padding: 20px;
}

.journal-content h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.journal-date {
    color: var(--text-light);
    font-size: 12px;
    margin-bottom: 12px;
}

.journal-excerpt {
    color: var(--text-grey);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
}

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

.pagination-btn {
    padding: 8px 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

/* ============================================
   頁腳 Footer
   ============================================ */
.footer {
    background: var(--nav-blue);
    color: #ccc;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 10px;
}

.footer-section p {
    line-height: 1.8;
    margin-bottom: 10px;
    font-size: 14px;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.footer-section ul li a:hover {
    color: var(--primary-red);
    padding-left: 5px;
}

.footer-section i {
    margin-right: 8px;
    color: var(--primary-red);
    width: 18px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 16px;
}

.social-links a:hover {
    background: var(--primary-red);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

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

/* ============================================
   移動端菜單 Mobile Menu
   ============================================ */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================
   響應式設計 Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .info-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .primary-nav-list {
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        background: var(--nav-blue);
        z-index: 9999;
        padding: 20px;
        transition: var(--transition);
        height: 100vh;
        overflow-y: auto;
    }
    
    .primary-nav-list.active {
        left: 0;
    }
    
    .nav-logo {
        margin-right: 15px;
    }
    
    .nav-logo-icon {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
    
    .primary-nav-list li {
        width: 100%;
    }
    
    .primary-nav-list a {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .logo-section-content {
        grid-template-columns: 1fr;
    }
    
    .logo-text-area h1 {
        font-size: 32px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .journal-info {
        flex-direction: column;
        text-align: center;
    }
    
    .journal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-logo-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .nav-logo-text {
        font-size: 16px;
        letter-spacing: 0.5px;
    }
    
    .logo-text-area h1 {
        font-size: 24px;
    }
    
    .logo-seal {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .news-article h3 {
        font-size: 18px;
    }
}
