/* ═══════════════════════════════════════
   Good News — Magazine Style Theme
   ═══════════════════════════════════════ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #e74c3c;
  --accent-dark: #c0392b;
  --border: #e0e0e0;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --hero-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --max-width: 1200px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang HK", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ─── Header ─── */
.site-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

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

.site-logo {
  font-size: 24px; font-weight: 800; text-decoration: none;
  color: var(--text-primary); letter-spacing: -0.5px;
}
.site-logo span { color: var(--accent); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  text-decoration: none; color: var(--text-secondary);
  padding: 8px 16px; border-radius: 20px;
  font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.main-nav a:hover { background: var(--bg-secondary); color: var(--text-primary); }
.main-nav a.active { background: var(--accent); color: #fff; }

.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* ─── Hero ─── */
.hero-section { padding: 30px 0; }

.hero-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  background: var(--hero-gradient);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.15); }

.hero-image { height: 100%; min-height: 350px; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-text {
  padding: 40px;
  display: flex; flex-direction: column;
  justify-content: center; color: #fff;
}
.hero-category {
  display: inline-block;
  background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 16px; width: fit-content;
}
.hero-title { font-size: 28px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.hero-summary { font-size: 15px; opacity: 0.85; line-height: 1.5; margin-bottom: 20px; }
.hero-meta { display: flex; align-items: center; gap: 16px; }
.hero-date { font-size: 13px; opacity: 0.7; }
.read-more { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.read-more:hover { text-decoration: underline; }

/* ─── Category Sections ─── */
.category-section { padding: 20px 0 40px; }
.category-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}
.category-title { font-size: 22px; font-weight: 700; }
.category-count { font-size: 13px; color: var(--text-secondary); }

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: transparent;
}

.card-image {
  height: 200px;
  overflow: hidden;
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.article-card:hover .card-image img { transform: scale(1.05); }

.card-body { padding: 20px; }
.card-category {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.card-title {
  font-size: 18px; font-weight: 600;
  line-height: 1.4; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-date {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 12px;
}

/* ─── Article Modal ─── */
.modal-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 20px;
}
.modal-overlay.open { display: block; }

.modal-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-primary);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: none; width: 36px; height: 36px;
  border-radius: 50%; font-size: 16px;
  cursor: pointer; z-index: 10;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.8); }

.full-article { padding: 0; }
.article-header { padding: 40px 40px 0; }
.article-category {
  display: inline-block;
  background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 600;
  margin-bottom: 16px;
}
.article-header h1 { font-size: 32px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.article-meta {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 24px;
}
.article-image { margin: 0 0 24px; }
.article-image img { width: 100%; max-height: 450px; object-fit: cover; }
.article-body {
  padding: 0 40px 40px;
  font-size: 17px; line-height: 1.8;
  color: var(--text-primary);
}
.article-body p { margin-bottom: 1.2em; }

/* ─── Footer ─── */
.site-footer {
  background: var(--bg-secondary);
  padding: 24px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .main-nav { display: none; flex-direction: column; position: absolute; top: 60px;
    left: 0; right: 0; background: var(--bg-primary);
    border-bottom: 1px solid var(--border); padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 99;
  }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-image { min-height: 200px; }
  .hero-text { padding: 24px; }
  .hero-title { font-size: 22px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-header { padding: 24px 24px 0; }
  .article-body { padding: 0 24px 24px; }
  .article-header h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  .article-grid { grid-template-columns: 1fr; }
  .card-image { height: 180px; }
}
